powerpc/numa: 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>
This commit is contained in:
Christophe Jaillet 2015-10-11 22:23:27 +02:00 коммит произвёл Michael Ellerman
Родитель 5fab1d1cb1
Коммит 1def37586f
1 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -276,7 +276,6 @@ static int of_node_to_nid_single(struct device_node *device)
/* Walk the device tree upwards, looking for an associativity id */ /* Walk the device tree upwards, looking for an associativity id */
int of_node_to_nid(struct device_node *device) int of_node_to_nid(struct device_node *device)
{ {
struct device_node *tmp;
int nid = -1; int nid = -1;
of_node_get(device); of_node_get(device);
@ -285,9 +284,7 @@ int of_node_to_nid(struct device_node *device)
if (nid != -1) if (nid != -1)
break; break;
tmp = device; device = of_get_next_parent(device);
device = of_get_parent(tmp);
of_node_put(tmp);
} }
of_node_put(device); of_node_put(device);