From: Philippe Reynes <tremyfr@gmail.com>
To: davem@davemloft.net, mw@semihalf.com, jszhang@marvell.com,
amitoj1606@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Philippe Reynes <tremyfr@gmail.com>
Subject: [PATCH 2/2] net: ethernet: mvpp2: use phy_ethtool_{get|set}_link_ksettings
Date: Tue, 28 Jun 2016 00:08:12 +0200 [thread overview]
Message-ID: <1467065292-20996-2-git-send-email-tremyfr@gmail.com> (raw)
In-Reply-To: <1467065292-20996-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/marvell/mvpp2.c | 22 ++--------------------
1 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 18477fe..0b04717 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5813,24 +5813,6 @@ static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
/* Ethtool methods */
-/* Get settings (phy address, speed) for ethtools */
-static int mvpp2_ethtool_get_settings(struct net_device *dev,
- struct ethtool_cmd *cmd)
-{
- if (!dev->phydev)
- return -ENODEV;
- return phy_ethtool_gset(dev->phydev, cmd);
-}
-
-/* Set settings (phy address, speed) for ethtools */
-static int mvpp2_ethtool_set_settings(struct net_device *dev,
- struct ethtool_cmd *cmd)
-{
- if (!dev->phydev)
- return -ENODEV;
- return phy_ethtool_sset(dev->phydev, cmd);
-}
-
/* Set interrupt coalescing for ethtools */
static int mvpp2_ethtool_set_coalesce(struct net_device *dev,
struct ethtool_coalesce *c)
@@ -5965,13 +5947,13 @@ static const struct net_device_ops mvpp2_netdev_ops = {
static const struct ethtool_ops mvpp2_eth_tool_ops = {
.get_link = ethtool_op_get_link,
- .get_settings = mvpp2_ethtool_get_settings,
- .set_settings = mvpp2_ethtool_set_settings,
.set_coalesce = mvpp2_ethtool_set_coalesce,
.get_coalesce = mvpp2_ethtool_get_coalesce,
.get_drvinfo = mvpp2_ethtool_get_drvinfo,
.get_ringparam = mvpp2_ethtool_get_ringparam,
.set_ringparam = mvpp2_ethtool_set_ringparam,
+ .get_link_ksettings = phy_ethtool_get_link_ksettings,
+ .set_link_ksettings = phy_ethtool_set_link_ksettings,
};
/* Driver initialization */
--
1.7.4.4
next prev parent reply other threads:[~2016-06-27 22:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-27 22:08 [PATCH 1/2] net: ethernet: mvpp2: use phydev from struct net_device Philippe Reynes
2016-06-27 22:08 ` Philippe Reynes [this message]
2016-06-29 10:05 ` [PATCH 2/2] net: ethernet: mvpp2: use phy_ethtool_{get|set}_link_ksettings David Miller
2016-06-29 10:04 ` [PATCH 1/2] net: ethernet: mvpp2: use phydev from struct net_device 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=1467065292-20996-2-git-send-email-tremyfr@gmail.com \
--to=tremyfr@gmail.com \
--cc=amitoj1606@gmail.com \
--cc=davem@davemloft.net \
--cc=jszhang@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).