mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 5/7] mci: parent fixups
Date: Mon, 15 Aug 2011 10:46:30 +0200	[thread overview]
Message-ID: <1313397992-3065-6-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1313397992-3065-1-git-send-email-s.hauer@pengutronix.de>

Make the mci host a child of the hardware device and the disk
a child of the mci host.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/atmel_mci.c  |    1 +
 drivers/mci/imx-esdhc.c  |    1 +
 drivers/mci/imx.c        |    1 +
 drivers/mci/mci-core.c   |    5 ++++-
 drivers/mci/omap_hsmmc.c |    1 +
 5 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index b4489dd..47e3924 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -449,6 +449,7 @@ static int mci_probe(struct device_d *hw_dev)
 	host->mci.send_cmd = mci_request;
 	host->mci.set_ios = mci_set_ios;
 	host->mci.init = mci_reset;
+	host->mci.hw_dev = dev;
 
 	host->mci.host_caps = pd->host_caps;
 	if (pd->bus_width >= 4)
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index e20b3b7..358f0dc 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -485,6 +485,7 @@ static int fsl_esdhc_probe(struct device_d *dev)
 	host->mci.set_ios = esdhc_set_ios;
 	host->mci.init = esdhc_init;
 	host->mci.host_caps = MMC_MODE_4BIT;
+	host->mci.hw_dev = dev;
 
 	host->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
 
diff --git a/drivers/mci/imx.c b/drivers/mci/imx.c
index 1f96e96..905c251 100644
--- a/drivers/mci/imx.c
+++ b/drivers/mci/imx.c
@@ -492,6 +492,7 @@ static int mxcmci_probe(struct device_d *dev)
 	host->mci.set_ios = mxcmci_set_ios;
 	host->mci.init = mxcmci_init;
 	host->mci.host_caps = MMC_MODE_4BIT;
+	host->mci.hw_dev = dev;
 
 	host->base = dev_request_mem_region(dev, 0);
 
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 6a29619..681de0a 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1177,6 +1177,7 @@ static int mci_card_probe(struct device_d *mci_dev)
 	struct mci_host *host = GET_MCI_PDATA(mci_dev);
 	struct ata_interface *p;
 	int rc;
+	struct device_d *dev;
 
 	/* start with a host interface reset */
 	rc = (host->init)(host, mci_dev);
@@ -1228,7 +1229,8 @@ static int mci_card_probe(struct device_d *mci_dev)
 	p->read = mci_sd_read;
 	p->priv = mci_dev;
 
-	add_generic_device("disk", -1, NULL, 0, mci->capacity, IORESOURCE_MEM, p);
+	dev = add_generic_device("disk", -1, NULL, 0, mci->capacity, IORESOURCE_MEM, p);
+	dev_add_child(&host->dev, dev);
 
 	pr_debug("SD Card successfully added\n");
 
@@ -1363,6 +1365,7 @@ int mci_register(struct mci_host *host)
 
 	strcpy(mci_dev->name, mci_driver.name);
 	mci_dev->platform_data = (void*)host;
+	dev_add_child(host->hw_dev, mci_dev);
 
 	return register_device(mci_dev);
 }
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index f47f190..5fdf445 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -557,6 +557,7 @@ static int omap_mmc_probe(struct device_d *dev)
 	hsmmc->mci.set_ios = mmc_set_ios;
 	hsmmc->mci.init = mmc_init_setup;
 	hsmmc->mci.host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS;
+	hsmmc->mci.hw_dev = dev;
 
 	hsmmc->base = dev_request_mem_region(dev, 0);
 
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-08-15  8:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15  8:46 [PATCH] " Sascha Hauer
2011-08-15  8:46 ` [PATCH 1/7] mci: embed mci_dev into mci_host instead of allocating it seperately Sascha Hauer
2011-08-15  8:46 ` [PATCH 2/7] net: make the ethernet device a child of the hardware device Sascha Hauer
2011-08-15  8:46 ` [PATCH 3/7] net mii: add a parent pointer to miidevs and set it to " Sascha Hauer
2011-08-15  8:46 ` [PATCH 4/7] console: make console device a child of " Sascha Hauer
2011-08-15  8:46 ` Sascha Hauer [this message]
2011-08-16 15:39   ` [PATCH 5/7] mci: parent fixups Jean-Christophe PLAGNIOL-VILLARD
2011-08-15  8:46 ` [PATCH 6/7] spi: make the spi devices children of the parent bus Sascha Hauer
2011-08-15  8:46 ` [PATCH 7/7] devinfo: beautify output Sascha Hauer
2011-08-15  9:14 ` [PATCH] parent fixups Jean-Christophe PLAGNIOL-VILLARD
2011-08-15 15:50   ` Sascha Hauer
2011-08-16  5:29     ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-16  5:36 ` [PATCH 1/4] device: update id support to allow device without id Jean-Christophe PLAGNIOL-VILLARD
2011-08-18  5:26   ` Sascha Hauer
2011-08-18  6:27     ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-16  5:36 ` [PATCH 2/4] add bus registration support Jean-Christophe PLAGNIOL-VILLARD
2011-08-18  5:14   ` Sascha Hauer
2011-08-16  5:36 ` [PATCH 3/4] platform_bus: add registrattion to bus Jean-Christophe PLAGNIOL-VILLARD
2011-08-16  5:36 ` [PATCH 4/4] switch all device/driver to platform_device/driver_(un)register Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1313397992-3065-6-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox