Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1607135
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net: stmmac: add set_mac to the stmmac_ops |
| Date | 2017-03-23 03:40 +0100 |
| Message-ID | <to0Pn-41N-9@gated-at.bofh.it> (permalink) |
| References | <tnOEy-37h-35@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Corentin Labbe <clabbe.montjoie@gmail.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.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] net: stmmac: add set_mac to the stmmac_ops Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-22 14:40 +0100 Re: [PATCH] net: stmmac: add set_mac to the stmmac_ops David Miller <davem@davemloft.net> - 2017-03-23 03:40 +0100
csiph-web