Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -3
+2 -3
arch/powerpc/kernel/prom.c
··· 784 784 { 785 785 of_node_get(np); 786 786 while (np) { 787 - struct device_node *old = np; 788 787 u32 chip_id; 789 788 790 789 /* ··· 794 795 of_node_put(np); 795 796 return chip_id; 796 797 } 797 - np = of_get_parent(np); 798 - of_node_put(old); 798 + 799 + np = of_get_next_parent(np); 799 800 } 800 801 return -1; 801 802 }