Commit d784bbad authored by Geert Uytterhoeven's avatar Geert Uytterhoeven
Browse files

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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/d8338ff1fd795912b466ccf55b49dcd6885b6925.1773241833.git.geert+renesas@glider.be
parent 6de23f81
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -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;
			}