summaryrefslogtreecommitdiffstats
path: root/drivers/mci/mci-core.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-05-26 15:27:19 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-05-30 12:18:28 +0200
commitabee214ba54640c8f85ae10dc62d4f90446a9c76 (patch)
treed7d782030bb6165f8a339917a51a393715b1f315 /drivers/mci/mci-core.c
parent895c0bee6e9621c4d87cf1b408b210682a748c5b (diff)
downloadbarebox-abee214ba54640c8f85ae10dc62d4f90446a9c76.tar.gz
barebox-abee214ba54640c8f85ae10dc62d4f90446a9c76.tar.xz
mci: set name of mci device to same name as the filename
We already have the possibility to register a mci with a certain filename to get persistent names. However, the device needed to find the probe parameter still has the name 'mcix'. This patch changes this by registering the mci device with the same name as the filename. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/mci-core.c')
-rw-r--r--drivers/mci/mci-core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 8e54941678..416168f79c 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1609,8 +1609,14 @@ int mci_register(struct mci_host *host)
mci = xzalloc(sizeof(*mci));
mci->host = host;
- strcpy(mci->dev.name, "mci");
- mci->dev.id = DEVICE_ID_DYNAMIC;
+ if (host->devname) {
+ strcpy(mci->dev.name, host->devname);
+ mci->dev.id = DEVICE_ID_SINGLE;
+ } else {
+ strcpy(mci->dev.name, "mci");
+ mci->dev.id = DEVICE_ID_DYNAMIC;
+ }
+
mci->dev.platform_data = host;
mci->dev.parent = host->hw_dev;