net: stmmac: fix unused-variable warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 17 Jun 2019 13:13:03 +0000 (15:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jun 2019 23:24:12 +0000 (16:24 -0700)
When building without CONFIG_OF, we get a harmless build warning:

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_phy_setup':
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:973:22: error: unused variable 'node' [-Werror=unused-variable]
  struct device_node *node = priv->plat->phy_node;

Reword it so we always use the local variable, by making it the
fwnode pointer instead of the device_node.

Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 06995159001868fa8d4c7da5e8cd37d2e49f019c..0d54809a6df927e3c2fe16a3c51f9a929c92e280 100644 (file)
@@ -980,14 +980,14 @@ static int stmmac_init_phy(struct net_device *dev)
 
 static int stmmac_phy_setup(struct stmmac_priv *priv)
 {
-       struct device_node *node = priv->plat->phylink_node;
+       struct fwnode_handle *fwnode = of_fwnode_handle(priv->plat->phylink_node);
        int mode = priv->plat->interface;
        struct phylink *phylink;
 
        priv->phylink_config.dev = &priv->dev->dev;
        priv->phylink_config.type = PHYLINK_NETDEV;
 
-       phylink = phylink_create(&priv->phylink_config, of_fwnode_handle(node),
+       phylink = phylink_create(&priv->phylink_config, fwnode,
                                 mode, &stmmac_phylink_mac_ops);
        if (IS_ERR(phylink))
                return PTR_ERR(phylink);