summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2026-03-11 16:14:14 +0100
committerGeert Uytterhoeven <geert+renesas@glider.be>2026-03-16 10:59:59 +0100
commitd784bbad7fcbfad42e0d12c8dae2eb9c17b327b4 (patch)
tree51146fab81d9e507edb7ff4427d563912cdd2d0c
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f (diff)
ARM: shmobile: rcar-gen2: Use of_phandle_args_equal() helper
Use the existing of_phandle_args_equal() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/d8338ff1fd795912b466ccf55b49dcd6885b6925.1773241833.git.geert+renesas@glider.be
-rw-r--r--arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
index 4277ba5b3ae0..747a96c58df1 100644
--- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
@@ -141,7 +141,7 @@ static struct notifier_block regulator_quirk_nb = {
static int __init rcar_gen2_regulator_quirk(void)
{
struct regulator_quirk *quirk, *pos, *tmp;
- struct of_phandle_args *argsa, *argsb;
+ struct of_phandle_args *args;
const struct of_device_id *id;
struct device_node *np;
u32 mon, addr;
@@ -171,14 +171,14 @@ static int __init rcar_gen2_regulator_quirk(void)
goto err_mem;
}
- argsa = &quirk->irq_args;
+ args = &quirk->irq_args;
memcpy(&quirk->i2c_msg, id->data, sizeof(quirk->i2c_msg));
quirk->id = id;
quirk->np = of_node_get(np);
quirk->i2c_msg.addr = addr;
- ret = of_irq_parse_one(np, 0, argsa);
+ ret = of_irq_parse_one(np, 0, args);
if (ret) { /* Skip invalid entry and continue */
of_node_put(np);
kfree(quirk);
@@ -186,15 +186,7 @@ static int __init rcar_gen2_regulator_quirk(void)
}
list_for_each_entry(pos, &quirk_list, list) {
- argsb = &pos->irq_args;
-
- if (argsa->args_count != argsb->args_count)
- continue;
-
- ret = memcmp(argsa->args, argsb->args,
- argsa->args_count *
- sizeof(argsa->args[0]));
- if (!ret) {
+ if (of_phandle_args_equal(args, &pos->irq_args)) {
pos->shared = true;
quirk->shared = true;
}