aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ldpaa_eth
diff options
context:
space:
mode:
authorTom Rini2018-10-11 20:07:48 -0400
committerTom Rini2018-10-12 07:41:24 -0400
commit15f22ac2eea5ee9f17b14a143c94e7480bbafbff (patch)
treed52f1bbbf1767d5c361880331d1b02e3ef21df18 /drivers/net/ldpaa_eth
parent0223462b373b975d970fa86e5e1a7eadd1d41820 (diff)
ldpaa_eth.c: Fix warning when PHYLIB is not enabled
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>
Diffstat (limited to 'drivers/net/ldpaa_eth')
-rw-r--r--drivers/net/ldpaa_eth/ldpaa_eth.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index fe1c03e9e43..73b7ba29dfd 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -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))