diff mbox series

[RFC,1/6] mmc: core: set card fwnode_handle

Message ID 42b56531a91e88eea8f57d6be0b01124e67c5232.1689802933.git.daniel@makrotopia.org
State Superseded
Headers show
Series nvmem: add block device NVMEM provider | expand

Commit Message

Daniel Golle July 19, 2023, 10:02 p.m. UTC
Instead of just populating dev.of_node, also 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 2c3074a605fc4..ecf6e23e4c307 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -361,6 +361,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);