net: dsa: use of_for_each_phandle
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Mon, 6 Nov 2017 21:11:50 +0000 (16:11 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Nov 2017 00:26:49 +0000 (09:26 +0900)
commitc52866655558e5fc87ceae8aac528a7e410c8a77
treead5e495febf1bc80007289a8becadfd98ce81436
parentf163da8853aa9d8060157a96ed314299b87ba070
net: dsa: use of_for_each_phandle

The OF code provides a of_for_each_phandle() helper to iterate over
phandles. Use it instead of arbitrary iterating ourselves over the list
of phandles hanging to the "link" property of the port's device node.

The of_phandle_iterator_next() helper calls of_node_put() itself on
it.node. Thus We must only do it ourselves if we break the loop.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa2.c