msm8916-openwrt/target/linux/generic/pending-6.1/450-13-mmc-core-set-card-fwnode_handle.patch
Daniel Golle fc153aa8d9 kernel: import pending patches adding support for NVMEM on UBI and MMC
Similar to supporting nvmem-layouts on MTD devices, also allow referencing
UBI and MMC devices in DT.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-15 19:06:36 +00:00

24 lines
754 B
Diff

From 644942a31719de674e2aa68f83d66bd8ae7e4fb7 Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Thu, 13 Jul 2023 04:12:21 +0100
Subject: [PATCH 13/15] mmc: core: set card fwnode_handle
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(+)
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -363,6 +363,8 @@ int mmc_add_card(struct mmc_card *card)
mmc_add_card_debugfs(card);
#endif
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);