net: stmmac: replace the serdes_up_after_phy_linkup field with a flag
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / stmicro / stmmac / stmmac_main.c
index 73002ed..d444514 100644 (file)
@@ -991,7 +991,8 @@ static void stmmac_mac_link_up(struct phylink_config *config,
        struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
        u32 old_ctrl, ctrl;
 
-       if (priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup)
+       if ((priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) &&
+           priv->plat->serdes_powerup)
                priv->plat->serdes_powerup(priv->dev, priv->plat->bsp_priv);
 
        old_ctrl = readl(priv->ioaddr + MAC_CTRL_REG);
@@ -3838,7 +3839,8 @@ static int __stmmac_open(struct net_device *dev,
 
        stmmac_reset_queues_param(priv);
 
-       if (!priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup) {
+       if (!(priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) &&
+           priv->plat->serdes_powerup) {
                ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
                if (ret < 0) {
                        netdev_err(priv->dev, "%s: Serdes powerup failed\n",
@@ -7623,7 +7625,8 @@ int stmmac_resume(struct device *dev)
                        stmmac_mdio_reset(priv->mii);
        }
 
-       if (!priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup) {
+       if (!(priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) &&
+           priv->plat->serdes_powerup) {
                ret = priv->plat->serdes_powerup(ndev,
                                                 priv->plat->bsp_priv);