]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mmc: sdhci-cadence6: Use dev_read_u32() for device tree property parsing
authorTanmay Kathpalia <tanmay.kathpalia@altera.com>
Tue, 7 Oct 2025 19:06:38 +0000 (12:06 -0700)
committerPeng Fan <peng.fan@nxp.com>
Fri, 10 Oct 2025 02:45:56 +0000 (10:45 +0800)
Convert device tree property parsing to use dev_read_u32(), which
handles endianness and simplifies the code.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/sdhci-cadence6.c

index 9a92b8437a6d80355630c41c8d23be36003e5432..ead96dc0c917eb3a03768b0b947d12f96a028aed 100644 (file)
@@ -180,10 +180,8 @@ static int sdhci_cdns6_reset_phy_dll(struct sdhci_cdns_plat *plat, bool reset)
 
 int sdhci_cdns6_phy_adj(struct udevice *dev, struct sdhci_cdns_plat *plat, u32 mode)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        struct sdhci_cdns6_phy_cfg *sdhci_cdns6_phy_cfgs;
        struct sdhci_cdns6_ctrl_cfg *sdhci_cdns6_ctrl_cfgs;
-       const fdt32_t *prop;
        u32 tmp;
        int i, ret;
 
@@ -216,19 +214,11 @@ int sdhci_cdns6_phy_adj(struct udevice *dev, struct sdhci_cdns_plat *plat, u32 m
                return -EINVAL;
        }
 
-       for (i = 0; i < SDHCI_CDNS6_PHY_CFG_NUM; i++) {
-               prop = fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
-                                  sdhci_cdns6_phy_cfgs[i].property, NULL);
-               if (prop)
-                       sdhci_cdns6_phy_cfgs[i].val = *prop;
-       }
+       for (i = 0; i < SDHCI_CDNS6_PHY_CFG_NUM; i++)
+               dev_read_u32(dev, sdhci_cdns6_phy_cfgs[i].property, &sdhci_cdns6_phy_cfgs[i].val);
 
-       for (i = 0; i < SDHCI_CDNS6_CTRL_CFG_NUM; i++) {
-               prop = fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
-                                  sdhci_cdns6_ctrl_cfgs[i].property, NULL);
-               if (prop)
-                       sdhci_cdns6_ctrl_cfgs[i].val = *prop;
-       }
+       for (i = 0; i < SDHCI_CDNS6_CTRL_CFG_NUM; i++)
+               dev_read_u32(dev, sdhci_cdns6_ctrl_cfgs[i].property, &sdhci_cdns6_ctrl_cfgs[i].val);
 
        /* Switch On the DLL Reset */
        sdhci_cdns6_reset_phy_dll(plat, true);