diff mbox series

[v2,7/9] mmc: core: set card fwnode_handle

Message ID f02d242f41294bf632eb1db8bd9d7959911f9784.1717031992.git.daniel@makrotopia.org (mailing list archive)
State New
Headers show
Series nvmem: implement block NVMEM provider | expand

Commit Message

Daniel Golle May 30, 2024, 2:15 a.m. UTC
Set fwnode in case it isn't set yet and of_node is present.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/mmc/core/bus.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 0ddaee0eae54..e1c5fc1b3ce4 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -364,6 +364,8 @@  int mmc_add_card(struct mmc_card *card)
 
 	mmc_add_card_debugfs(card);
 	card->dev.of_node = mmc_of_find_child_device(card->host, 0);
+	if (card->dev.of_node && !card->dev.fwnode)
+		card->dev.fwnode = &card->dev.of_node->fwnode;
 
 	device_enable_async_suspend(&card->dev);