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:
parent
218bb57dd7
commit
ab958e3864
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user