mmc: core: set card fwnode_handle

Message ID ZK91G1qd8JwFEpIX@makrotopia.org
State New
Headers
Series mmc: core: set card fwnode_handle |

Commit Message

Daniel Golle July 13, 2023, 3:52 a.m. UTC
  Also set card's device 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(+)
  

Comments

Greg KH July 13, 2023, 3:50 p.m. UTC | #1
On Thu, Jul 13, 2023 at 04:52:59AM +0100, Daniel Golle wrote:
> Also set card's device fwnode in case it isn't set yet and of_node is
> present.

How is this "also" when you are only doing 1 thing in the patch?


> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

What commit id does this fix?

Why is this needed?

Should it go to stable tree?

thanks,

greg k-h
  

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);