diff options
author | Cédric Le Goater <clg@kaod.org> | 2021-10-12 08:20:08 +0200 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2021-10-12 08:20:08 +0200 |
commit | a7d78beff46f8e5c4343edca4b76675e6e55172e (patch) | |
tree | 044f8245d4fca9b61618b4a58268ba3091b8fc3b /hw | |
parent | 30b6852ce4c3398c54fc6f6c7ff5ccbf8c15cf4f (diff) |
aspeed/smc: Remove the 'flash' attribute from AspeedSMCFlash
There is no need to keep a reference of the flash qdev in the AspeedSMCFlash
state: the SPI bus takes ownership and will release its resources. Remove
AspeedSMCFlash::flash.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/arm/aspeed.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index ba5f1dc5af..854413594d 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -274,18 +274,17 @@ static void aspeed_board_init_flashes(AspeedSMCState *s, int i ; for (i = 0; i < s->num_cs; ++i) { - AspeedSMCFlash *fl = &s->flashes[i]; DriveInfo *dinfo = drive_get_next(IF_MTD); qemu_irq cs_line; + DeviceState *dev; - fl->flash = qdev_new(flashtype); + dev = qdev_new(flashtype); if (dinfo) { - qdev_prop_set_drive(fl->flash, "drive", - blk_by_legacy_dinfo(dinfo)); + qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(dinfo)); } - qdev_realize_and_unref(fl->flash, BUS(s->spi), &error_fatal); + qdev_realize_and_unref(dev, BUS(s->spi), &error_fatal); - cs_line = qdev_get_gpio_in_named(fl->flash, SSI_GPIO_CS, 0); + cs_line = qdev_get_gpio_in_named(dev, SSI_GPIO_CS, 0); sysbus_connect_irq(SYS_BUS_DEVICE(s), i + 1, cs_line); } } |