[PATCH 34/61] net: ethernet: smsc: simplify getting .drvdata

Wolfram Sang
2018-04-19T14:17:31Z

We should get drvdata 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. Please apply individually.

drivers/net/ethernet/smsc/smc91x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 080428762858..3e84a499fe92 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2453,8 +2453,7 @@ static int smc_drv_remove(struct platform_device *pdev)

static int smc_drv_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);

if (ndev) {
if (netif_running(ndev)) {
--
2.11.0