[PATCH] mci: move optee_rpmb_detected() to where the card is detected

Sascha Hauer s.hauer at pengutronix.de
Thu Mar 19 00:02:00 PDT 2026


mci_register() only registers a host controller, but depending on
configuration the card is not detected in this function. Move
the call to optee_rpmb_detected() to mci_card_probe() where the
card is actually detected.

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

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index b5a7e6f6bf..cdb20a5625 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -2984,6 +2984,9 @@ static int mci_card_probe(struct mci *mci)
 
 	mci_parse_cid(mci);
 
+	if (mci->rpmb_part)
+		optee_rpmb_detected();
+
 	dev_dbg(&mci->dev, "Card successfully added\n");
 
 on_error:
@@ -3123,9 +3126,6 @@ int mci_register(struct mci_host *host)
 
 	class_add_device(&mmc_class, &mci->dev);
 
-	if (mci->rpmb_part)
-		optee_rpmb_detected();
-
 	return 0;
 
 err_free:
-- 
2.47.3




More information about the barebox mailing list