Patchwork [V2,09/10] SD card: make SD card a child of host controller

login
register
mail settings
Submitter Mitsyanko Igor
Date April 5, 2012, 3:48 p.m.
Message ID <1333640913-16028-10-git-send-email-i.mitsyanko@samsung.com>
Download mbox | patch
Permalink /patch/151051/
State New
Headers show

Comments

Mitsyanko Igor - April 5, 2012, 3:48 p.m.
Only for host controllers implemented as QOM object.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
---
 hw/milkymist-memcard.c |    1 +
 hw/pl181.c             |    1 +
 hw/ssi-sd.c            |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/milkymist-memcard.c b/hw/milkymist-memcard.c
index 80cac20..c8a6bae 100644
--- a/hw/milkymist-memcard.c
+++ b/hw/milkymist-memcard.c
@@ -259,6 +259,7 @@  static int milkymist_memcard_init(SysBusDevice *dev)
         object_property_set_int(OBJECT(s->card), dinfo->unit, "if-idx", &errp);
     }
     object_property_set_bool(OBJECT(s->card), false, "spi-mode", &errp);
+    object_property_add_child(OBJECT(s), "card", OBJECT(s->card), &errp);
     assert_no_error(errp);
     SD_INIT(s->card);
     s->enabled = dinfo ? bdrv_is_inserted(dinfo->bdrv) : 0;
diff --git a/hw/pl181.c b/hw/pl181.c
index 48720ae..5f81531 100644
--- a/hw/pl181.c
+++ b/hw/pl181.c
@@ -490,6 +490,7 @@  static int pl181_init(SysBusDevice *dev)
         object_property_set_int(OBJECT(s->card), dinfo->unit, "if-idx", &errp);
     }
     object_property_set_bool(OBJECT(s->card), false, "spi-mode", &errp);
+    object_property_add_child(OBJECT(s), "card", OBJECT(s->card), &errp);
     assert_no_error(errp);
     SD_INIT(s->card);
     return 0;
diff --git a/hw/ssi-sd.c b/hw/ssi-sd.c
index 9f4510d..f30a553 100644
--- a/hw/ssi-sd.c
+++ b/hw/ssi-sd.c
@@ -245,6 +245,7 @@  static int ssi_sd_init(SSISlave *dev)
         object_property_set_int(OBJECT(s->sd), dinfo->unit, "if-idx", &errp);
     }
     object_property_set_bool(OBJECT(s->sd), true, "spi-mode", &errp);
+    object_property_add_child(OBJECT(s), "card", OBJECT(s->sd), &errp);
     assert_no_error(errp);
     SD_INIT(s->sd);
     register_savevm(&dev->qdev, "ssi_sd", -1, 1, ssi_sd_save, ssi_sd_load, s);