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>
This commit is contained in:
Philippe Mathieu-Daudé 2018-02-08 13:47:49 -03:00 committed by Paolo Bonzini
parent 218bb57dd7
commit ab958e3864

View File

@ -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;
}