summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2015-10-26 00:48:46 (GMT)
committerMichael Ellerman <mpe@ellerman.id.au>2015-10-28 03:08:32 (GMT)
commit16c1d606263ea37754be0d0ed655ab1c99c4cf7e (patch)
tree0b01dab5e281a3152906ea188b114e84bc32367b /arch/powerpc
parentf755ecfb8cec7b19dff84295309f2afb24a5afd1 (diff)
downloadlinux-16c1d606263ea37754be0d0ed655ab1c99c4cf7e.tar.xz
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: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/prom.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 0b0a416..7030b03 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -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;
}