public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Philippe Reynes <tremyfr@gmail.com>,
	jaedon.shin@gmail.com, davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net-next 3/3] net: bcmgenet: use new api ethtool_{get|set}_link_ksettings
Date: Mon, 26 Sep 2016 11:07:40 -0700	[thread overview]
Message-ID: <d396ba92-7808-5530-099c-25836140e682@gmail.com> (raw)
In-Reply-To: <1474820967-1130-4-git-send-email-tremyfr@gmail.com>

On 09/25/2016 09:29 AM, Philippe Reynes wrote:
> The ethtool api {get|set}_settings is deprecated.
> We move this driver to new api {get|set}_link_ksettings.
> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> ---
>  drivers/net/ethernet/broadcom/genet/bcmgenet.c |   24 ++++++++++--------------
>  1 files changed, 10 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index 47d0a2b..2c5d9d3 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -450,32 +450,28 @@ static inline void bcmgenet_rdma_ring_writel(struct bcmgenet_priv *priv,
>  			genet_dma_ring_regs[r]);
>  }
>  
> -static int bcmgenet_get_settings(struct net_device *dev,
> -				 struct ethtool_cmd *cmd)
> +static int bcmgenet_get_link_ksettings(struct net_device *dev,
> +				       struct ethtool_link_ksettings *cmd)
>  {
> -	struct bcmgenet_priv *priv = netdev_priv(dev);
> -
>  	if (!netif_running(dev))
>  		return -EINVAL;
>  
> -	if (!priv->phydev)
> +	if (!dev->phydev)
>  		return -ENODEV;
>  
> -	return phy_ethtool_gset(priv->phydev, cmd);
> +	return phy_ethtool_ksettings_get(dev->phydev, cmd);

Can't we just use priv->phydev now instead of dev->phydev? This should
really be identical in terms of phydev lifecycle, but it just feels more
consistent to use it.
-- 
Florian

      reply	other threads:[~2016-09-26 18:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 16:29 [PATCH v2 net-next 0/3] net: bcmgenet: only use new api ethtool_{get|set}_link_ksettings Philippe Reynes
2016-09-25 16:29 ` [PATCH v2 net-next 1/3] Revert "net: ethernet: bcmgenet: use new api ethtool_{get|set}_link_ksettings" Philippe Reynes
2016-09-25 16:29 ` [PATCH v2 net-next 2/3] Revert "net: ethernet: bcmgenet: use phydev from struct net_device" Philippe Reynes
2016-09-25 16:29 ` [PATCH v2 net-next 3/3] net: bcmgenet: use new api ethtool_{get|set}_link_ksettings Philippe Reynes
2016-09-26 18:07   ` Florian Fainelli [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=d396ba92-7808-5530-099c-25836140e682@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jaedon.shin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tremyfr@gmail.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