mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: clabbe.montjoie@gmail.com
Cc: peppe.cavallaro@st.com, alexandre.torgue@st.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: stmmac: add set_mac to the stmmac_ops
Date: Wed, 22 Mar 2017 19:29:46 -0700 (PDT)	[thread overview]
Message-ID: <20170322.192946.905863899824397633.davem@davemloft.net> (raw)
In-Reply-To: <20170322132904.2687-1-clabbe.montjoie@gmail.com>

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.

      reply	other threads:[~2017-03-23  2:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22 13:29 Corentin Labbe
2017-03-23  2:29 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170322.192946.905863899824397633.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexandre.torgue@st.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®