From: Michael Ellerman Date: Mon, 26 Oct 2015 00:48:46 +0000 (+0900) Subject: powerpc/prom: Use of_get_next_parent() in of_get_ibm_chip_id() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=16c1d606263ea37754be0d0ed655ab1c99c4cf7e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 0b0a4166d69d..7030b035905d 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; }