[PATCH] mci: core: don't add broken_cd parameter for eMMCs

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jun 17 04:40:47 PDT 2024


We only register the fixup for SDs, so registering the device parameter
for eMMCs serves no purpose, thus register it for SDs only as well.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/mci/mci-core.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index d40519f124b9..cb65227af208 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -2556,9 +2556,6 @@ int mci_register(struct mci_host *host)
 	dev_add_param_bool(&mci->dev, "probe", mci_set_probe, NULL,
 			   &mci->probe, mci);
 
-	dev_add_param_bool(&mci->dev, "broken_cd", NULL, NULL,
-			   &host->broken_cd, mci);
-
 	if (IS_ENABLED(CONFIG_MCI_INFO))
 		mci->dev.info = mci_info;
 
@@ -2566,8 +2563,12 @@ int mci_register(struct mci_host *host)
 	if (IS_ENABLED(CONFIG_MCI_STARTUP))
 		mci_card_probe(mci);
 
-	if (!(host->caps2 & MMC_CAP2_NO_SD) && dev_of_node(host->hw_dev))
+	if (!(host->caps2 & MMC_CAP2_NO_SD) && dev_of_node(host->hw_dev)) {
+		dev_add_param_bool(&mci->dev, "broken_cd", NULL, NULL,
+				   &host->broken_cd, mci);
+
 		of_register_fixup(of_broken_cd_fixup, host);
+	}
 
 	list_add_tail(&mci->list, &mci_list);
 
-- 
2.39.2




More information about the barebox mailing list