Skip to content

Commit

Permalink
powerpc/mpc5xxx: Use of_get_next_parent to simplify code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe Jaillet authored and Michael Ellerman committed Oct 15, 2015
1 parent 1def375 commit b340587
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/powerpc/sysdev/mpc5xxx_clocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

unsigned long mpc5xxx_get_bus_frequency(struct device_node *node)
{
struct device_node *np;
const unsigned int *p_bus_freq = NULL;

of_node_get(node);
Expand All @@ -22,9 +21,7 @@ unsigned long mpc5xxx_get_bus_frequency(struct device_node *node)
if (p_bus_freq)
break;

np = of_get_parent(node);
of_node_put(node);
node = np;
node = of_get_next_parent(node);
}
of_node_put(node);

Expand Down

0 comments on commit b340587

Please sign in to comment.