[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20170322.192946.905863899824397633.davem@davemloft.net>
Date: Wed, 22 Mar 2017 19:29:46 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: clabbe.montjoie@...il.com
Cc: peppe.cavallaro@...com, alexandre.torgue@...com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: stmmac: add set_mac to the stmmac_ops
From: Corentin Labbe <clabbe.montjoie@...il.com>
Date: Wed, 22 Mar 2017 14:29:04 +0100
> @@ -2224,7 +2222,8 @@ static int stmmac_release(struct net_device *dev)
> free_dma_desc_resources(priv);
>
> /* Disable the MAC Rx/Tx */
> - stmmac_set_mac(priv->ioaddr, false);
> + if (priv->hw->mac->set_mac)
> + priv->hw->mac->set_mac(priv->ioaddr, false);
>
> netif_carrier_off(dev);
>
> @@ -3710,7 +3709,8 @@ int stmmac_dvr_remove(struct device *dev)
>
> stmmac_stop_all_dma(priv);
>
> - stmmac_set_mac(priv->ioaddr, false);
> + if (priv->hw->mac->set_mac)
> + priv->hw->mac->set_mac(priv->ioaddr, false);
> netif_carrier_off(ndev);
> unregister_netdev(ndev);
> if (priv->plat->stmmac_rst)
> @@ -3761,7 +3761,8 @@ int stmmac_suspend(struct device *dev)
> priv->hw->mac->pmt(priv->hw, priv->wolopts);
> priv->irq_wake = 1;
> } else {
> - stmmac_set_mac(priv->ioaddr, false);
> + if (priv->hw->mac->set_mac)
> + priv->hw->mac->set_mac(priv->ioaddr, false);
> pinctrl_pm_select_sleep_state(priv->device);
> /* Disable clock in case of PWM is off */
> clk_disable(priv->plat->pclk);
I'd say this is pretty much a required method, so it doesn't make any
sense to guard the calls with a NULL check. Every implementation of
the MAC ops must at least set set_mac to stmmac_set_mac().
So please remove the checks, thanks.
Powered by blists - more mailing lists