From: Philippe Reynes <tremyfr@gmail.com>
To: mans@mansr.com, davem@davemloft.net, sf84@laposte.net, arnd@arndb.de
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Philippe Reynes <tremyfr@gmail.com>
Subject: [PATCH 2/2] net: ethernet: nb8800: use phy_ethtool_{get|set}_link_ksettings
Date: Sat, 18 Jun 2016 23:16:55 +0200 [thread overview]
Message-ID: <1466284615-7045-2-git-send-email-tremyfr@gmail.com> (raw)
In-Reply-To: <1466284615-7045-1-git-send-email-tremyfr@gmail.com>
There are two generics functions phy_ethtool_{get|set}_link_ksettings,
so we can use them instead of defining the same code in the driver.
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
drivers/net/ethernet/aurora/nb8800.c | 24 ++----------------------
1 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c
index 4989d31..dc2c35d 100644
--- a/drivers/net/ethernet/aurora/nb8800.c
+++ b/drivers/net/ethernet/aurora/nb8800.c
@@ -1035,26 +1035,6 @@ static const struct net_device_ops nb8800_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
};
-static int nb8800_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
-{
- struct phy_device *phydev = dev->phydev;
-
- if (!phydev)
- return -ENODEV;
-
- return phy_ethtool_gset(phydev, cmd);
-}
-
-static int nb8800_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
-{
- struct phy_device *phydev = dev->phydev;
-
- if (!phydev)
- return -ENODEV;
-
- return phy_ethtool_sset(phydev, cmd);
-}
-
static int nb8800_nway_reset(struct net_device *dev)
{
struct phy_device *phydev = dev->phydev;
@@ -1183,8 +1163,6 @@ static void nb8800_get_ethtool_stats(struct net_device *dev,
}
static const struct ethtool_ops nb8800_ethtool_ops = {
- .get_settings = nb8800_get_settings,
- .set_settings = nb8800_set_settings,
.nway_reset = nb8800_nway_reset,
.get_link = ethtool_op_get_link,
.get_pauseparam = nb8800_get_pauseparam,
@@ -1192,6 +1170,8 @@ static const struct ethtool_ops nb8800_ethtool_ops = {
.get_sset_count = nb8800_get_sset_count,
.get_strings = nb8800_get_strings,
.get_ethtool_stats = nb8800_get_ethtool_stats,
+ .get_link_ksettings = phy_ethtool_get_link_ksettings,
+ .set_link_ksettings = phy_ethtool_set_link_ksettings,
};
static int nb8800_hw_init(struct net_device *dev)
--
1.7.4.4
next prev parent reply other threads:[~2016-06-18 21:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-18 21:16 [PATCH 1/2] net: ethernet: nb8800: use phydev from struct net_device Philippe Reynes
2016-06-18 21:16 ` Philippe Reynes [this message]
2016-06-19 11:32 ` [PATCH 2/2] net: ethernet: nb8800: use phy_ethtool_{get|set}_link_ksettings Måns Rullgård
2016-06-19 17:55 ` David Miller
2016-06-19 11:31 ` [PATCH 1/2] net: ethernet: nb8800: use phydev from struct net_device Måns Rullgård
2016-06-19 17:55 ` David Miller
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=1466284615-7045-2-git-send-email-tremyfr@gmail.com \
--to=tremyfr@gmail.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mans@mansr.com \
--cc=netdev@vger.kernel.org \
--cc=sf84@laposte.net \
/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
Powered by JetHome