enetc: Fix unused var build warning for CONFIG_OF
authorArnd Bergmann <arnd@arndb.de>
Fri, 4 Dec 2020 12:08:00 +0000 (14:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:06:22 +0000 (17:06 +0100)
commita3df6b7a8a41e1b42bed5b7121372e0a9c623036
tree379512379335c77052ebb6547d7ea6a46e18fa26
parent606cfdeebd3d0f79b0acb2b7da5556318097698a
enetc: Fix unused var build warning for CONFIG_OF

[ Upstream commit 4560b2a3ecdd5d587c4c6eea4339899f173a559a ]

When CONFIG_OF is disabled, there is a harmless warning about
an unused variable:

enetc_pf.c: In function 'enetc_phylink_create':
enetc_pf.c:981:17: error: unused variable 'dev' [-Werror=unused-variable]

Slightly rearrange the code to pass around the of_node as a
function argument, which avoids the problem without hurting
readability.

Fixes: 71b77a7a27a3 ("enetc: Migrate to PHYLINK and PCS_LYNX")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Link: https://lore.kernel.org/r/20201204120800.17193-1-claudiu.manoil@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc_pf.c