All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
To: "David S. Miller" <davem@davemloft.net>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: <netdev@vger.kernel.org>, <linux-renesas-soc@vger.kernel.org>
Subject: [PATCH 5/6] sh_eth: remove custom .get_link_ksettings from ethtool ops
Date: Thu, 24 May 2018 14:14:43 +0300	[thread overview]
Message-ID: <1527160484-11087-1-git-send-email-vladimir_zapolskiy@mentor.com> (raw)
In-Reply-To: <1527160318-10958-1-git-send-email-vladimir_zapolskiy@mentor.com>

The change replaces a custom implementation of .get_link_ksettings
callback with a shared phy_ethtool_get_link_ksettings(), note that
&priv->lock wrapping is not needed, because the lock does not
serialize access to phydev fields.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
 drivers/net/ethernet/renesas/sh_eth.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 6d1fed2b4a4a..e627b2b6c3b3 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2019,22 +2019,6 @@ static int sh_eth_phy_start(struct net_device *ndev)
 	return 0;
 }
 
-static int sh_eth_get_link_ksettings(struct net_device *ndev,
-				     struct ethtool_link_ksettings *cmd)
-{
-	struct sh_eth_private *mdp = netdev_priv(ndev);
-	unsigned long flags;
-
-	if (!ndev->phydev)
-		return -ENODEV;
-
-	spin_lock_irqsave(&mdp->lock, flags);
-	phy_ethtool_ksettings_get(ndev->phydev, cmd);
-	spin_unlock_irqrestore(&mdp->lock, flags);
-
-	return 0;
-}
-
 static int sh_eth_set_link_ksettings(struct net_device *ndev,
 				     const struct ethtool_link_ksettings *cmd)
 {
@@ -2411,7 +2395,7 @@ static const struct ethtool_ops sh_eth_ethtool_ops = {
 	.get_sset_count     = sh_eth_get_sset_count,
 	.get_ringparam	= sh_eth_get_ringparam,
 	.set_ringparam	= sh_eth_set_ringparam,
-	.get_link_ksettings = sh_eth_get_link_ksettings,
+	.get_link_ksettings = phy_ethtool_get_link_ksettings,
 	.set_link_ksettings = sh_eth_set_link_ksettings,
 	.get_wol	= sh_eth_get_wol,
 	.set_wol	= sh_eth_set_wol,
-- 
2.8.1

  parent reply	other threads:[~2018-05-24 11:14 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 11:11 [PATCH 0/6] ravb/sh_eth: fix sleep in atomic by reusing shared ethtool handlers Vladimir Zapolskiy
2018-05-24 11:11 ` [PATCH 1/6] ravb: remove custom .nway_reset from ethtool ops Vladimir Zapolskiy
2018-05-24 13:22   ` Andrew Lunn
2018-05-24 14:11     ` Vladimir Zapolskiy
2018-05-24 14:11       ` Vladimir Zapolskiy
2018-05-24 16:18       ` Sergei Shtylyov
2018-05-24 16:44         ` Andrew Lunn
2018-05-24 17:01           ` Sergei Shtylyov
2018-05-24 17:23             ` Andrew Lunn
2018-05-25  6:05             ` Vladimir Zapolskiy
2018-05-25  6:05               ` Vladimir Zapolskiy
2018-05-26 16:56   ` Sergei Shtylyov
2018-05-26 16:56   ` Sergei Shtylyov
2018-05-26 17:51   ` Sergei Shtylyov
2018-05-24 11:11 ` [PATCH 2/6] ravb: remove custom .get_link_ksettings " Vladimir Zapolskiy
2018-05-26 17:07   ` Sergei Shtylyov
2018-05-24 11:11 ` [PATCH 3/6] ravb: remove custom .set_link_ksettings " Vladimir Zapolskiy
2018-05-24 13:29   ` Andrew Lunn
2018-05-24 14:06     ` Vladimir Zapolskiy
2018-05-24 14:06       ` Vladimir Zapolskiy
2018-05-26 19:50   ` Sergei Shtylyov
2018-05-28  9:51     ` Vladimir Zapolskiy
2018-05-28  9:51       ` Vladimir Zapolskiy
2018-06-03 15:42       ` Sergei Shtylyov
2018-06-04 11:07         ` Vladimir Zapolskiy
2018-06-04 11:07           ` Vladimir Zapolskiy
2018-06-06 20:34           ` Sergei Shtylyov
2018-05-24 11:11 ` [PATCH 4/6] sh_eth: remove custom .nway_reset " Vladimir Zapolskiy
2018-05-24 13:30   ` Andrew Lunn
2018-05-26 18:46   ` Sergei Shtylyov
2018-05-26 19:22     ` Sergei Shtylyov
2018-05-24 11:14 ` Vladimir Zapolskiy [this message]
2018-05-24 11:14   ` [PATCH 6/6] sh_eth: remove custom .set_link_ksettings " Vladimir Zapolskiy
2018-05-24 13:31   ` [PATCH 5/6] sh_eth: remove custom .get_link_ksettings " Andrew Lunn
2018-05-24 16:40 ` [PATCH 0/6] ravb/sh_eth: fix sleep in atomic by reusing shared ethtool handlers Sergei Shtylyov
2018-05-24 17:24   ` Sergei Shtylyov
2018-05-25  6:25     ` Vladimir Zapolskiy
2018-05-25  6:25       ` Vladimir Zapolskiy
2018-05-26 17:31       ` Sergei Shtylyov
2018-05-25  8:11 ` Geert Uytterhoeven

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=1527160484-11087-1-git-send-email-vladimir_zapolskiy@mentor.com \
    --to=vladimir_zapolskiy@mentor.com \
    --cc=davem@davemloft.net \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.