diff options
| author | Tanmay Kathpalia <[email protected]> | 2025-10-07 12:06:38 -0700 |
|---|---|---|
| committer | Peng Fan <[email protected]> | 2025-10-10 10:45:56 +0800 |
| commit | 0524f40947b4dfdd15d1905c6041ef0579a25093 (patch) | |
| tree | 8ee4563d60e8fd1b41b62b57e1e2fbc24ec4532c | |
| parent | ecdc3872a767fb045be3296d4317ae978a14b022 (diff) | |
mmc: sdhci-cadence6: Use dev_read_u32() for device tree property parsing
Convert device tree property parsing to use dev_read_u32(), which
handles endianness and simplifies the code.
Signed-off-by: Tanmay Kathpalia <[email protected]>
Signed-off-by: Peng Fan <[email protected]>
| -rw-r--r-- | drivers/mmc/sdhci-cadence6.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/mmc/sdhci-cadence6.c b/drivers/mmc/sdhci-cadence6.c index 9a92b8437a6..ead96dc0c91 100644 --- a/drivers/mmc/sdhci-cadence6.c +++ b/drivers/mmc/sdhci-cadence6.c @@ -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); |
