aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2015-10-11 22:27:40 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2015-10-15 20:32:01 +1100
commitb340587e68b479e52039f800d7c60abd417e1975 (patch)
tree68d481a8fed7f94cae6ca442ab8b97536f5b037c /arch/powerpc/sysdev
parentpowerpc/numa: Use of_get_next_parent to simplify code (diff)
downloadlinux-dev-b340587e68b479e52039f800d7c60abd417e1975.tar.xz
linux-dev-b340587e68b479e52039f800d7c60abd417e1975.zip
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>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/mpc5xxx_clocks.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/powerpc/sysdev/mpc5xxx_clocks.c b/arch/powerpc/sysdev/mpc5xxx_clocks.c
index f4f0301b9a60..573292663cf2 100644
--- a/arch/powerpc/sysdev/mpc5xxx_clocks.c
+++ b/arch/powerpc/sysdev/mpc5xxx_clocks.c
@@ -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);
@@ -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);