]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ARM: shmobile: rcar-gen2: Use of_phandle_args_equal() helper
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 11 Mar 2026 15:14:14 +0000 (16:14 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 16 Mar 2026 09:59:59 +0000 (10:59 +0100)
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
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c

index 4277ba5b3ae052bb311685676d2d57e0f2511e87..747a96c58df150755117ab65e10981a80d009c67 100644 (file)
@@ -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;
                        }