aboutsummaryrefslogtreecommitdiff
path: root/hw/sd/pxa2xx_mmci.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-07-05 23:22:57 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-08-21 16:22:43 +0200
commita0e63983a646338c06a146d0d9d52f9a06a88ec4 (patch)
treeb95c58ff5819e2358bd1ceaa948d946bf2eef84f /hw/sd/pxa2xx_mmci.c
parentd7ebca748e33176ede1a8675cea82271d2c0dac4 (diff)
downloadqemu-a0e63983a646338c06a146d0d9d52f9a06a88ec4.zip
qemu-a0e63983a646338c06a146d0d9d52f9a06a88ec4.tar.gz
qemu-a0e63983a646338c06a146d0d9d52f9a06a88ec4.tar.bz2
hw/sd/pxa2xx_mmci: Trivial simplification
Avoid declaring PXA2xxMMCIState local variable, return it directly. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Acked-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200705213350.24725-3-f4bug@amsat.org>
Diffstat (limited to 'hw/sd/pxa2xx_mmci.c')
-rw-r--r--hw/sd/pxa2xx_mmci.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c
index 9482b92..2996a2e 100644
--- a/hw/sd/pxa2xx_mmci.c
+++ b/hw/sd/pxa2xx_mmci.c
@@ -480,10 +480,8 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
{
DeviceState *dev;
SysBusDevice *sbd;
- PXA2xxMMCIState *s;
dev = qdev_new(TYPE_PXA2XX_MMCI);
- s = PXA2XX_MMCI(dev);
sbd = SYS_BUS_DEVICE(dev);
sysbus_mmio_map(sbd, 0, base);
sysbus_connect_irq(sbd, 0, irq);
@@ -491,7 +489,7 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma);
sysbus_realize_and_unref(sbd, &error_fatal);
- return s;
+ return PXA2XX_MMCI(dev);
}
static void pxa2xx_mmci_set_inserted(DeviceState *dev, bool inserted)