net: lan966x: add missing fwnode_handle_put() for ports node
authorClément Léger <clement.leger@bootlin.com>
Thu, 12 Jan 2023 16:13:11 +0000 (17:13 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Jan 2023 05:53:28 +0000 (21:53 -0800)
commit925f3deb45df73173a33e1e81db77575f4ffde39
tree8987553a09d304c31c43b9c25bfecb1e1804e0e0
parent3c463721a73bdb57a913e0d3124677a3758886fc
net: lan966x: add missing fwnode_handle_put() for ports node

Since the "ethernet-ports" node is retrieved using
device_get_named_child_node(), it should be release after using it. Add
missing fwnode_handle_put() and move the code that retrieved the node
from device-tree to avoid complicated handling in case of error.

Fixes: db8bcaad5393 ("net: lan966x: add the basic lan966x driver")
Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://lore.kernel.org/r/20230112161311.495124-1-clement.leger@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c