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)
committerJakub Kicinski <kuba@kernel.org>
Sat, 5 Dec 2020 22:56:23 +0000 (14:56 -0800)
commit4560b2a3ecdd5d587c4c6eea4339899f173a559a
treed392b09cfe9a48d38a31a09c6447c01658632769
parenta7e1abad13f3f0366ee625831fecda2b603cdc17
enetc: Fix unused var build warning for CONFIG_OF

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>
drivers/net/ethernet/freescale/enetc/enetc_pf.c