ldpaa_eth.c: Fix warning when PHYLIB is not enabled
authorTom Rini <trini@konsulko.com>
Fri, 12 Oct 2018 00:07:48 +0000 (20:07 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 12 Oct 2018 11:41:24 +0000 (07:41 -0400)
We need to #ifdef some variables to avoid warning about them being
unused.

Fixes: 1a048cd65645 ("driver: net: fsl-mc: Add support of multiple phys for dpmac")
Signed-off-by: Tom Rini <trini@konsulko.com>
drivers/net/ldpaa_eth/ldpaa_eth.c

index fe1c03e..73b7ba2 100644 (file)
@@ -402,10 +402,12 @@ error:
 static int ldpaa_get_dpmac_state(struct ldpaa_eth_priv *priv,
                                 struct dpmac_link_state *state)
 {
-       struct phy_device *phydev = NULL;
        phy_interface_t enet_if;
-       int phy_num, phys_detected;
-       int err;
+       int phys_detected;
+#ifdef CONFIG_PHYLIB
+       struct phy_device *phydev = NULL;
+       int err, phy_num;
+#endif
 
        /* let's start off with maximum capabilities */
        enet_if = wriop_get_enet_if(priv->dpmac_id);
@@ -590,8 +592,10 @@ static void ldpaa_eth_stop(struct eth_device *net_dev)
 {
        struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv;
        int err = 0;
+#ifdef CONFIG_PHYLIB
        struct phy_device *phydev = NULL;
        int phy_num;
+#endif
 
        if ((net_dev->state == ETH_STATE_PASSIVE) ||
            (net_dev->state == ETH_STATE_INIT))