diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-15 09:44:04 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-17 09:36:30 +0200 |
commit | c41360cd207f91a5b19732c97e568846c53675f0 (patch) | |
tree | bc638d30fc0c4e006ee685d59cd6fbe906f8b2c9 /drivers | |
parent | ad140020b8229c14c9b18fb0dd0c5af3373cdf56 (diff) | |
download | barebox-c41360cd207f91a5b19732c97e568846c53675f0.tar.gz barebox-c41360cd207f91a5b19732c97e568846c53675f0.tar.xz |
mci: parent fixups
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mci/atmel_mci.c | 1 | ||||
-rw-r--r-- | drivers/mci/imx-esdhc.c | 1 | ||||
-rw-r--r-- | drivers/mci/imx.c | 1 | ||||
-rw-r--r-- | drivers/mci/mci-core.c | 5 | ||||
-rw-r--r-- | 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 b4489dd19e..71aec16fa2 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 = hw_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 e20b3b7a65..358f0dc25c 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 1f96e96607..905c251db3 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 6a29619882..681de0a444 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 f47f1907c2..5fdf445c70 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); |