[PATCH 05/11] mci: tegra: handle mmc aliases

Lucas Stach dev at lynxeye.de
Tue Mar 3 11:46:17 PST 2015


This allows to have fixed device names for the SDMMC
controllers.

Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 drivers/mci/tegra-sdmmc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mci/tegra-sdmmc.c b/drivers/mci/tegra-sdmmc.c
index 0e23d6f..c8924ed 100644
--- a/drivers/mci/tegra-sdmmc.c
+++ b/drivers/mci/tegra-sdmmc.c
@@ -409,7 +409,10 @@ static int tegra_sdmmc_detect(struct device_d *dev)
 static void tegra_sdmmc_parse_dt(struct tegra_sdmmc_host *host)
 {
 	struct device_node *np = host->mci.hw_dev->device_node;
+	const char *alias = of_alias_get(np);
 
+	if (alias)
+		host->mci.devname = xstrdup(alias);
 	host->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0);
 	host->gpio_pwr = of_get_named_gpio(np, "power-gpios", 0);
 	mci_of_parse(&host->mci);
-- 
2.1.0




More information about the barebox mailing list