sh: make use of for_each_node_by_type()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 17 Aug 2018 22:44:17 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Aug 2018 23:20:27 +0000 (16:20 -0700)
commit82f7c5103dcdd714486a64cfc5783cc4608d124c
tree654a705b9389e0cf50dbe554e6e75e119fe92628
parentab62ef82ea49b8814f4b0e2fe61426acda793fb9
sh: make use of for_each_node_by_type()

Instead of open-coding the loop, let's use canned macro.

Also make sure we are not leaking "cpus" node reference.

Link: http://lkml.kernel.org/r/20180624224252.GA220395@dtor-ws
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/sh/boards/of-generic.c