]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
power: regulator: qcom-rpmh: convert ofnode API to dev_read API
authorPeng Fan <peng.fan@nxp.com>
Thu, 4 Jun 2026 12:20:33 +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(dev_ofnode(dev), ...) with
dev_read_u32(dev, ...), ofnode_read_string(dev_ofnode(dev), ...) with
dev_read_string(dev, ...), and ofnode_for_each_subnode(node,
dev_ofnode(dev)) with dev_for_each_subnode(node, dev).

No functional change.

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

index 4d65aae1690acd9c1bc07a705419a3d43ef84add..f1de660c3a0f44b2aa48f3306a90769ddf10acb6 100644 (file)
@@ -5,6 +5,7 @@
 #define pr_fmt(fmt) "%s: " fmt, __func__
 
 #include <linux/err.h>
+#include <dm.h>
 #include <dm/device_compat.h>
 #include <dm/device.h>
 #include <dm/devres.h>
@@ -882,7 +883,7 @@ static int rpmh_regulator_probe(struct udevice *dev)
        priv->hw_data = init_data->hw_data;
        priv->enabled = -EINVAL;
        priv->uv = -ENOTRECOVERABLE;
-       if (ofnode_read_u32(dev_ofnode(dev), "regulator-initial-mode", &priv->mode))
+       if (dev_read_u32(dev, "regulator-initial-mode", &priv->mode))
                priv->mode = -EINVAL;
 
        plat_data->mode = priv->hw_data->pmic_mode_map;
@@ -933,7 +934,7 @@ static int rpmh_regulators_bind(struct udevice *dev)
                return -ENODEV;
        }
 
-       pmic_id = ofnode_read_string(dev_ofnode(dev), "qcom,pmic-id");
+       pmic_id = dev_read_string(dev, "qcom,pmic-id");
        if (!pmic_id) {
                dev_err(dev, "No PMIC ID\n");
                return -ENODEV;
@@ -941,7 +942,7 @@ static int rpmh_regulators_bind(struct udevice *dev)
 
        drv = lists_driver_lookup_name("rpmh_regulator_drm");
 
-       ofnode_for_each_subnode(node, dev_ofnode(dev)) {
+       dev_for_each_subnode(node, dev) {
                data = vreg_get_init_data(init_data, node);
                if (!data)
                        continue;