Convert the OMAP MMC controller to the new SDBus API:
* the controller creates an SDBus bus
* instead of sd_foo functions on the SDState object, call
sdbus_foo functions on the SDBus
* the board code creates a proper TYPE_SD_CARD object and attaches
it to the controller's SDBus, instead of the controller creating
a card directly via sd_init() that never gets attached to any bus
* because the SD card object is on a bus, it gets reset automatically
by the "traverse the qbus tree resetting things" code, and we don't
need to manually reset the card from the controller reset function
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/hw/arm/omap.h | 1 -
hw/arm/omap1.c | 10 +++++++++-
hw/sd/omap_mmc.c | 30 ++++++++++--------------------
3 files changed, 19 insertions(+), 22 deletions(-)
@@ -643,6 +630,9 @@ static void omap_mmc_initfn(Object *obj)
static void omap_mmc_realize(DeviceState *dev, Error **errp)
{
+ OMAPMMCState *s = OMAP_MMC(dev);
+
+ qbus_init(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS, dev, "sd-bus");