summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <[email protected]>2026-06-04 20:20:28 +0800
committerPeng Fan <[email protected]>2026-06-09 23:55:56 +0800
commit788259b6c969de9e9ffc122464aca8fc5a08c7f6 (patch)
tree608e9879f246050c30cd66c403b6935adcde68ee
parent8e873d7ad3e72ebb4b995a73e1e2b93793248abb (diff)
power: domain: meson-gx-pwrc-vpu: use dev_read_phandle_with_args for hhi-sysctrl
Replace the manual ofnode_read_u32() + ofnode_get_by_phandle() sequence with a single dev_read_phandle_with_args() call to resolve the amlogic,hhi-sysctrl phandle. This is cleaner and avoids the intermediate phandle value and ofnode_valid() check. No functional change. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Peng Fan <[email protected]>
-rw-r--r--drivers/power/domain/meson-gx-pwrc-vpu.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/power/domain/meson-gx-pwrc-vpu.c b/drivers/power/domain/meson-gx-pwrc-vpu.c
index 325296b0dd7..e08c0fac49a 100644
--- a/drivers/power/domain/meson-gx-pwrc-vpu.c
+++ b/drivers/power/domain/meson-gx-pwrc-vpu.c
@@ -283,24 +283,19 @@ static const struct udevice_id meson_gx_pwrc_vpu_ids[] = {
static int meson_gx_pwrc_vpu_probe(struct udevice *dev)
{
struct meson_gx_pwrc_vpu_priv *priv = dev_get_priv(dev);
- u32 hhi_phandle;
- ofnode hhi_node;
+ struct ofnode_phandle_args args;
int ret;
priv->regmap_ao = syscon_node_to_regmap(dev_ofnode(dev_get_parent(dev)));
if (IS_ERR(priv->regmap_ao))
return PTR_ERR(priv->regmap_ao);
- ret = ofnode_read_u32(dev_ofnode(dev), "amlogic,hhi-sysctrl",
- &hhi_phandle);
+ ret = dev_read_phandle_with_args(dev, "amlogic,hhi-sysctrl", NULL, 0, 0,
+ &args);
if (ret)
return ret;
- hhi_node = ofnode_get_by_phandle(hhi_phandle);
- if (!ofnode_valid(hhi_node))
- return -EINVAL;
-
- priv->regmap_hhi = syscon_node_to_regmap(hhi_node);
+ priv->regmap_hhi = syscon_node_to_regmap(args.node);
if (IS_ERR(priv->regmap_hhi))
return PTR_ERR(priv->regmap_hhi);