Skip to content

Commit 9ac4203

Browse files
committed
Merge tag 'renesas-arm-soc-for-v7.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/arm
Renesas ARM SoC updates for v7.1 - Use the of_phandle_args_equal() helper. * tag 'renesas-arm-soc-for-v7.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: rcar-gen2: Use of_phandle_args_equal() helper Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 23e4b05 + d784bba commit 9ac4203

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static struct notifier_block regulator_quirk_nb = {
141141
static int __init rcar_gen2_regulator_quirk(void)
142142
{
143143
struct regulator_quirk *quirk, *pos, *tmp;
144-
struct of_phandle_args *argsa, *argsb;
144+
struct of_phandle_args *args;
145145
const struct of_device_id *id;
146146
struct device_node *np;
147147
u32 mon, addr;
@@ -171,30 +171,22 @@ static int __init rcar_gen2_regulator_quirk(void)
171171
goto err_mem;
172172
}
173173

174-
argsa = &quirk->irq_args;
174+
args = &quirk->irq_args;
175175
memcpy(&quirk->i2c_msg, id->data, sizeof(quirk->i2c_msg));
176176

177177
quirk->id = id;
178178
quirk->np = of_node_get(np);
179179
quirk->i2c_msg.addr = addr;
180180

181-
ret = of_irq_parse_one(np, 0, argsa);
181+
ret = of_irq_parse_one(np, 0, args);
182182
if (ret) { /* Skip invalid entry and continue */
183183
of_node_put(np);
184184
kfree(quirk);
185185
continue;
186186
}
187187

188188
list_for_each_entry(pos, &quirk_list, list) {
189-
argsb = &pos->irq_args;
190-
191-
if (argsa->args_count != argsb->args_count)
192-
continue;
193-
194-
ret = memcmp(argsa->args, argsb->args,
195-
argsa->args_count *
196-
sizeof(argsa->args[0]));
197-
if (!ret) {
189+
if (of_phandle_args_equal(args, &pos->irq_args)) {
198190
pos->shared = true;
199191
quirk->shared = true;
200192
}

0 commit comments

Comments
 (0)