]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mmc: msm_sdhci: convert ofnode API to dev_read API
authorPeng Fan <peng.fan@nxp.com>
Thu, 4 Jun 2026 12:20:25 +0000 (20:20 +0800)
committerPeng Fan <peng.fan@nxp.com>
Tue, 9 Jun 2026 15:55:56 +0000 (23:55 +0800)
Replace ofnode_read_u32(), ofnode_get_property() and
ofnode_read_string_index() with their dev_read_*() equivalents in
msm_sdc_clk_init(). Remove the intermediate 'ofnode node' local
variable.

No functional change.

Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/msm_sdhci.c

index aaa87923604b1cf43d4d6919f909a9c1fcb97a87..7bdb02142a2428e227fff608eefc6aa5afa4c748 100644 (file)
@@ -64,14 +64,13 @@ static int msm_sdc_clk_init(struct udevice *dev)
 {
        struct msm_sdhc *prv = dev_get_priv(dev);
        const struct msm_sdhc_variant_info *var_info;
-       ofnode node = dev_ofnode(dev);
        ulong clk_rate;
        int ret, i = 0, n_clks;
        const char *clk_name;
 
        var_info = (void *)dev_get_driver_data(dev);
 
-       if (ofnode_read_u32(node, "max-frequency", (uint *)(&clk_rate)))
+       if (dev_read_u32(dev, "max-frequency", (uint *)(&clk_rate)))
                clk_rate = 201500000;
 
        ret = clk_get_bulk(dev, &prv->clks);
@@ -87,7 +86,7 @@ static int msm_sdc_clk_init(struct udevice *dev)
        }
 
        /* If clock-names is unspecified, then the first clock is the core clock */
-       if (!ofnode_get_property(node, "clock-names", &n_clks)) {
+       if (!dev_read_prop(dev, "clock-names", &n_clks)) {
                if (!clk_set_rate(&prv->clks.clks[0], clk_rate)) {
                        log_warning("Couldn't set core clock rate: %d\n", ret);
                        return -EINVAL;
@@ -96,7 +95,7 @@ static int msm_sdc_clk_init(struct udevice *dev)
 
        /* Find the index of the "core" clock */
        while (i < n_clks) {
-               ofnode_read_string_index(node, "clock-names", i, &clk_name);
+               dev_read_string_index(dev, "clock-names", i, &clk_name);
                if (!strcmp(clk_name, "core"))
                        break;
                i++;