Skip to contentSkip to conversation

mmc: Use device API to replace devfdt_ helpers

PATCH In review Peng Fan (OSS) 2 participants 5 messages May 25 – May 27 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

cover mmc: Use device API to replace devfdt_ helpers

The goal is to remove the direct usage of devfdt_ APIs in drivers. The device APIs supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.

---
Peng Fan (2):
mmc: xenon_sdhci: Use livetree API
mmc: cv1800b_sdhci: Use dev_read_addr_ptr()

 drivers/mmc/cv1800b_sdhci.c | 2 +-
 drivers/mmc/xenon_sdhci.c   | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

---
base-commit: bb354d04459f5425318aeb8a70bae995ee573f1d
change-id: 20260525-devfdt-mmc-4c8b3d4cc005

Best regards,

Signature · 1 line
Peng Fan <[email protected]>
#1 lore raw

PATCH 1/2 mmc: xenon_sdhci: Use livetree API

From: Peng Fan <[email protected]>

Use livetree API which supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.

No functional changes.

---
 drivers/mmc/xenon_sdhci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mmc/xenon_sdhci.c +2 -3
index 0e4902fab77..6aa73792f96 100644
@@ -537,10 +537,9 @@ static int xenon_sdhci_of_to_plat(struct udevice *dev)
 	host->ioaddr = dev_read_addr_ptr(dev);
 
 	if (device_is_compatible(dev, "marvell,armada-3700-sdhci"))
-		priv->pad_ctrl_reg = devfdt_get_addr_index_ptr(dev, 1);
+		priv->pad_ctrl_reg = dev_read_addr_index_ptr(dev, 1);
 
-	name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "marvell,pad-type",
-			   NULL);
+	name = ofnode_get_property(dev_ofnode(dev), "marvell,pad-type", NULL);
 	if (name) {
 		if (0 == strncmp(name, "sd", 2)) {
 			priv->pad_type = SOC_PAD_SD;
Signature · 1 line
2.51.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] mmc: xenon_sdhci: Use livetree API

Quoted 8 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Use livetree API which supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.

No functional changes.

Thanks,
Stefan

Quoted 22 lines
---
  drivers/mmc/xenon_sdhci.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mmc/xenon_sdhci.c +2 -3
index 0e4902fab77..6aa73792f96 100644
@@ -537,10 +537,9 @@ static int xenon_sdhci_of_to_plat(struct udevice *dev)
  	host->ioaddr = dev_read_addr_ptr(dev);
 
  	if (device_is_compatible(dev, "marvell,armada-3700-sdhci"))
-		priv->pad_ctrl_reg = devfdt_get_addr_index_ptr(dev, 1);
+		priv->pad_ctrl_reg = dev_read_addr_index_ptr(dev, 1);
 
-	name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "marvell,pad-type",
-			   NULL);
+	name = ofnode_get_property(dev_ofnode(dev), "marvell,pad-type", NULL);
  	if (name) {
  		if (0 == strncmp(name, "sd", 2)) {
  			priv->pad_type = SOC_PAD_SD;
#3 lore raw

PATCH 2/2 mmc: cv1800b_sdhci: Use dev_read_addr_ptr()

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Use dev_read_addr_ptr() which supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.

No functional changes.

---
 drivers/mmc/cv1800b_sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/cv1800b_sdhci.c +1 -1
index 72c5bfc6f35..b756649f90f 100644
@@ -85,7 +85,7 @@ static int cv1800b_sdhci_probe(struct udevice *dev)
 	int ret;
 
 	host->name = dev->name;
-	host->ioaddr = devfdt_get_addr_ptr(dev);
+	host->ioaddr = dev_read_addr_ptr(dev);
 
 	upriv->mmc = &plat->mmc;
 	host->mmc = &plat->mmc;
Signature · 1 line
2.51.0
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] mmc: cv1800b_sdhci: Use dev_read_addr_ptr()

Quoted 8 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Use dev_read_addr_ptr() which supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers.

No functional changes.

Thanks,
Stefan

Quoted 18 lines
---
  drivers/mmc/cv1800b_sdhci.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/cv1800b_sdhci.c +1 -1
index 72c5bfc6f35..b756649f90f 100644
@@ -85,7 +85,7 @@ static int cv1800b_sdhci_probe(struct udevice *dev)
  	int ret;
 
  	host->name = dev->name;
-	host->ioaddr = devfdt_get_addr_ptr(dev);
+	host->ioaddr = dev_read_addr_ptr(dev);
 
  	upriv->mmc = &plat->mmc;
  	host->mmc = &plat->mmc;