diff options
author | Marian Rotariu <marian.rotariu@freescale.com> | 2014-02-04 16:34:45 (GMT) |
---|---|---|
committer | Madalin-Cristian Bucur <madalin.bucur@freescale.com> | 2014-02-18 17:11:59 (GMT) |
commit | fd2ac0f677998a95fd813ef97f7aeaededad31bc (patch) | |
tree | 7347064a14c4e716ac2a1f4e604c0806e95ed5b0 /drivers/net/ethernet | |
parent | 3b97a8acdd7d70ba9a99e9c7370742d05c861781 (diff) | |
download | linux-fsl-qoriq-fd2ac0f677998a95fd813ef97f7aeaededad31bc.tar.xz |
dpaa_eth: fix PM functions for proxy driver
Run-time information regarding proxy interface should be stored and acquired
only through dev_set_drvdata() and dev_get_drvdata() primitives. This
information is essential for macless driver capability of controling a MAC
device.
Change-Id: Icaad66952874e5835b1086c0aa225ae331fc6f5f
Signed-off-by: Marian Rotariu <marian.rotariu@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/8725
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Cristian-Constantin Sovaiala <Cristian.Sovaiala@freescale.com>
Reviewed-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
(cherry picked from commit 50e51c4f00960b29644398532cf2481e46945f9e)
Reviewed-on: http://git.am.freescale.net:8181/8908
Tested-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c index 293eb58..41478fd 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c @@ -58,14 +58,13 @@ module_param(debug, byte, S_IRUGO); MODULE_PARM_DESC(debug, "Module/Driver verbosity level"); static int __cold dpa_eth_proxy_remove(struct platform_device *of_dev); -static struct proxy_device *proxy_dev; - #ifdef CONFIG_PM static int proxy_suspend_noirq(struct device *dev) { - struct mac_device *mac_dev = proxy_dev->mac_dev; - int err = 0; + struct proxy_device *proxy_dev = dev_get_drvdata(dev); + struct mac_device *mac_dev = proxy_dev->mac_dev; + int err = 0; err = fm_port_suspend(mac_dev->port_dev[RX]); if (err) @@ -81,6 +80,7 @@ port_suspend_failed: static int proxy_resume_noirq(struct device *dev) { + struct proxy_device *proxy_dev = dev_get_drvdata(dev); struct mac_device *mac_dev = proxy_dev->mac_dev; int err = 0; @@ -120,6 +120,7 @@ static int dpaa_eth_proxy_probe(struct platform_device *_of_dev) struct fm_port_fqs port_fqs; struct dpa_buffer_layout_s *buf_layout = NULL; struct mac_device *mac_dev; + struct proxy_device *proxy_dev; dev = &_of_dev->dev; @@ -304,13 +305,13 @@ int dpa_proxy_stop(struct proxy_device *proxy_dev, struct net_device *net_dev) static int __cold dpa_eth_proxy_remove(struct platform_device *of_dev) { - struct device *dev; - - dev = &of_dev->dev; - dev_set_drvdata(dev, NULL); + struct device *dev = &of_dev->dev; + struct proxy_device *proxy_dev = dev_get_drvdata(dev); kfree(proxy_dev); + dev_set_drvdata(dev, NULL); + return 0; } |