Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16c1d606 authored by Michael Ellerman's avatar Michael Ellerman
Browse files

powerpc/prom: Use of_get_next_parent() in of_get_ibm_chip_id()



Use of_get_next_parent() to simplifiy the logic in of_get_ibm_chip_id().

Original-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent f755ecfb
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -784,7 +784,6 @@ int of_get_ibm_chip_id(struct device_node *np)
{
	of_node_get(np);
	while (np) {
		struct device_node *old = np;
		u32 chip_id;

		/*
@@ -795,8 +794,8 @@ int of_get_ibm_chip_id(struct device_node *np)
			of_node_put(np);
			return chip_id;
		}
		np = of_get_parent(np);
		of_node_put(old);

		np = of_get_next_parent(np);
	}
	return -1;
}