[PATCH] mmc: omap: name mmc device after devicetree alias

Sascha Hauer s.hauer at pengutronix.de
Mon Nov 25 03:19:29 EST 2013


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/mci/omap_hsmmc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index 19db461..357d99a 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -620,6 +620,12 @@ static int omap_mmc_probe(struct device_d *dev)
 			hsmmc->mci.devname = pdata->devname;
 	}
 
+	if (dev->device_node) {
+		const char *alias = of_alias_get(dev->device_node);
+		if (alias)
+			hsmmc->mci.devname = xstrdup(alias);
+	}
+
 	dev->priv = hsmmc;
 	dev->detect = omap_mmc_detect,
 
-- 
1.8.4.2




More information about the barebox mailing list