diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2018-02-08 13:47:49 -0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-02-13 11:44:13 +0100 |
commit | ab958e3864c70bf45fe4a688ba231250d39339cf (patch) | |
tree | b8a7a5a9df283377b81174c33c389206b0c95f09 /hw | |
parent | 218bb57dd79d6843e0592c30a82ea8c1fddc74a5 (diff) |
sdhci: use error_propagate(local_err) in realize()
avoid the "errp && *errp" pattern (not recommended in "qapi/error.h" comments).
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-Id: <20180208164818.7961-2-f4bug@amsat.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/sd/sdhci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index ee95e78aeb..3602286f46 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1302,10 +1302,12 @@ static Property sdhci_pci_properties[] = { static void sdhci_pci_realize(PCIDevice *dev, Error **errp) { SDHCIState *s = PCI_SDHCI(dev); + Error *local_err = NULL; sdhci_initfn(s); sdhci_common_realize(s, errp); - if (errp && *errp) { + if (local_err) { + error_propagate(errp, local_err); return; } @@ -1383,9 +1385,11 @@ static void sdhci_sysbus_realize(DeviceState *dev, Error ** errp) { SDHCIState *s = SYSBUS_SDHCI(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); + Error *local_err = NULL; sdhci_common_realize(s, errp); - if (errp && *errp) { + if (local_err) { + error_propagate(errp, local_err); return; } |