Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ethernet: ti: davinci_emac: simplify getting .driver_data

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wolfram Sang and committed by
David S. Miller
762b9e9a 4e13c252

+2 -4
+2 -4
drivers/net/ethernet/ti/davinci_emac.c
··· 2002 2002 2003 2003 static int davinci_emac_suspend(struct device *dev) 2004 2004 { 2005 - struct platform_device *pdev = to_platform_device(dev); 2006 - struct net_device *ndev = platform_get_drvdata(pdev); 2005 + struct net_device *ndev = dev_get_drvdata(dev); 2007 2006 2008 2007 if (netif_running(ndev)) 2009 2008 emac_dev_stop(ndev); ··· 2012 2013 2013 2014 static int davinci_emac_resume(struct device *dev) 2014 2015 { 2015 - struct platform_device *pdev = to_platform_device(dev); 2016 - struct net_device *ndev = platform_get_drvdata(pdev); 2016 + struct net_device *ndev = dev_get_drvdata(dev); 2017 2017 2018 2018 if (netif_running(ndev)) 2019 2019 emac_dev_open(ndev);