powerpc/mpc5xxx: Use of_get_next_parent to simplify code
of_get_next_parent can be used to simplify the while() loop and avoid the need of a temp variable. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
1def37586f
commit
b340587e68
1 changed files with 1 additions and 4 deletions
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
unsigned long mpc5xxx_get_bus_frequency(struct device_node *node)
|
unsigned long mpc5xxx_get_bus_frequency(struct device_node *node)
|
||||||
{
|
{
|
||||||
struct device_node *np;
|
|
||||||
const unsigned int *p_bus_freq = NULL;
|
const unsigned int *p_bus_freq = NULL;
|
||||||
|
|
||||||
of_node_get(node);
|
of_node_get(node);
|
||||||
|
@ -22,9 +21,7 @@ unsigned long mpc5xxx_get_bus_frequency(struct device_node *node)
|
||||||
if (p_bus_freq)
|
if (p_bus_freq)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
np = of_get_parent(node);
|
node = of_get_next_parent(node);
|
||||||
of_node_put(node);
|
|
||||||
node = np;
|
|
||||||
}
|
}
|
||||||
of_node_put(node);
|
of_node_put(node);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue