lkml.org 
[lkml]   [2021]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] mmc: dw_mmc: use standard "mmc" alias stem
Date
The standard stem for MMC aliases is "mmc" and this is used by the MMC
core to set the slot index.

Use this in preference to the non-standard "mshc" stem when setting the
controller ID to avoid needing two aliases for each MMC device in order
to cover both the core and dw_mmc-specific functionality.

The old "mshc" lookup is kept for backwards compatibility.

Signed-off-by: John Keeping <john@metanate.com>
---
drivers/mmc/host/dw_mmc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 37af1245304b..6ffaa354410a 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -112,7 +112,11 @@ int dw_mci_of_alias_get_id(struct dw_mci *host)
if (WARN_ON(!host->dev->of_node))
return 0;

- ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
+ ctrl_id = of_alias_get_id(host->dev->of_node, "mmc");
+
+ /* Compatibility fallback for old device trees. */
+ if (ctrl_id < 0)
+ ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");

if (ctrl_id < 0)
ctrl_id = 0;
--
2.34.0
\
 
 \ /
  Last update: 2021-11-16 20:04    [W:0.074 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site