From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-kernel@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Grygorii Strashko <grygorii.strashko@ti.com>,
"David S. Miller" <davem@davemloft.net>,
linux-omap@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 6/9] net: ethernet: ti: cpsw: simplify getting .driver_data
Date: Sun, 21 Oct 2018 22:00:17 +0200 [thread overview]
Message-ID: <20181021200021.1693-7-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20181021200021.1693-1-wsa+renesas@sang-engineering.com>
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Build tested only. buildbot is happy.
drivers/net/ethernet/ti/cpsw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 16dcbf36f8cc..4753ae7178fb 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -3658,8 +3658,7 @@ static int cpsw_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int cpsw_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct net_device *ndev = platform_get_drvdata(pdev);
+ struct net_device *ndev = dev_get_drvdata(dev);
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
if (cpsw->data.dual_emac) {
@@ -3682,8 +3681,7 @@ static int cpsw_suspend(struct device *dev)
static int cpsw_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct net_device *ndev = platform_get_drvdata(pdev);
+ struct net_device *ndev = dev_get_drvdata(dev);
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
/* Select default pin state */
--
2.19.0
next prev parent reply other threads:[~2018-10-21 20:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-21 20:00 [PATCH 0/9] net: simplify getting .driver_data Wolfram Sang
2018-10-21 20:00 ` [PATCH 1/9] net: dsa: bcm_sf2: " Wolfram Sang
2018-10-21 23:16 ` Andrew Lunn
2018-10-22 17:01 ` Florian Fainelli
2018-10-21 20:00 ` [PATCH 2/9] net: dsa: qca8k: " Wolfram Sang
2018-10-21 23:15 ` Andrew Lunn
2018-10-22 17:01 ` Florian Fainelli
2018-10-21 20:00 ` [PATCH 3/9] net: ethernet: cadence: macb_main: " Wolfram Sang
2018-10-21 20:00 ` [PATCH 4/9] net: ethernet: davicom: dm9000: " Wolfram Sang
2018-10-21 20:00 ` [PATCH 5/9] net: ethernet: smsc: smc91x: " Wolfram Sang
2018-10-21 20:00 ` Wolfram Sang [this message]
2018-10-21 20:00 ` [PATCH 7/9] net: ethernet: ti: davinci_emac: " Wolfram Sang
2018-10-21 20:00 ` [PATCH 8/9] net: ethernet: wiznet: w5300: " Wolfram Sang
2018-10-21 20:00 ` [PATCH 9/9] net: phy: mdio-mux-bcm-iproc: " Wolfram Sang
2018-10-21 23:14 ` Andrew Lunn
2018-10-22 17:02 ` Florian Fainelli
2018-10-22 4:11 ` [PATCH 0/9] net: " David Miller
2018-10-22 17:05 ` Florian Fainelli
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=20181021200021.1693-7-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--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).