diff options
author | chaithrika@ti.com <chaithrika@ti.com> | 2010-03-10 17:37:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-15 18:46:59 -0400 |
commit | d4fdcd923daf9d03d2e1b956d66f05c3f2ca4c43 (patch) | |
tree | 160222c21b390472f1fabdfd095aea635a16d069 /drivers/net/davinci_emac.c | |
parent | be5bce2bf5cfe021bc6bdff4d49fa18776bc293d (diff) |
TI DaVinci EMAC: Convert to dev_pm_ops
Migrate from the legacy PM hooks to use dev_pm_ops structure.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/davinci_emac.c')
-rw-r--r-- | drivers/net/davinci_emac.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 491e64cbd2a2..5c4f5b14ff02 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c | |||
@@ -2827,31 +2827,37 @@ static int __devexit davinci_emac_remove(struct platform_device *pdev) | |||
2827 | return 0; | 2827 | return 0; |
2828 | } | 2828 | } |
2829 | 2829 | ||
2830 | static | 2830 | static int davinci_emac_suspend(struct device *dev) |
2831 | int davinci_emac_suspend(struct platform_device *pdev, pm_message_t state) | ||
2832 | { | 2831 | { |
2833 | struct net_device *dev = platform_get_drvdata(pdev); | 2832 | struct platform_device *pdev = to_platform_device(dev); |
2833 | struct net_device *ndev = platform_get_drvdata(pdev); | ||
2834 | 2834 | ||
2835 | if (netif_running(dev)) | 2835 | if (netif_running(ndev)) |
2836 | emac_dev_stop(dev); | 2836 | emac_dev_stop(ndev); |
2837 | 2837 | ||
2838 | clk_disable(emac_clk); | 2838 | clk_disable(emac_clk); |
2839 | 2839 | ||
2840 | return 0; | 2840 | return 0; |
2841 | } | 2841 | } |
2842 | 2842 | ||
2843 | static int davinci_emac_resume(struct platform_device *pdev) | 2843 | static int davinci_emac_resume(struct device *dev) |
2844 | { | 2844 | { |
2845 | struct net_device *dev = platform_get_drvdata(pdev); | 2845 | struct platform_device *pdev = to_platform_device(dev); |
2846 | struct net_device *ndev = platform_get_drvdata(pdev); | ||
2846 | 2847 | ||
2847 | clk_enable(emac_clk); | 2848 | clk_enable(emac_clk); |
2848 | 2849 | ||
2849 | if (netif_running(dev)) | 2850 | if (netif_running(ndev)) |
2850 | emac_dev_open(dev); | 2851 | emac_dev_open(ndev); |
2851 | 2852 | ||
2852 | return 0; | 2853 | return 0; |
2853 | } | 2854 | } |
2854 | 2855 | ||
2856 | static const struct dev_pm_ops davinci_emac_pm_ops = { | ||
2857 | .suspend = davinci_emac_suspend, | ||
2858 | .resume = davinci_emac_resume, | ||
2859 | }; | ||
2860 | |||
2855 | /** | 2861 | /** |
2856 | * davinci_emac_driver: EMAC platform driver structure | 2862 | * davinci_emac_driver: EMAC platform driver structure |
2857 | */ | 2863 | */ |
@@ -2859,11 +2865,10 @@ static struct platform_driver davinci_emac_driver = { | |||
2859 | .driver = { | 2865 | .driver = { |
2860 | .name = "davinci_emac", | 2866 | .name = "davinci_emac", |
2861 | .owner = THIS_MODULE, | 2867 | .owner = THIS_MODULE, |
2868 | .pm = &davinci_emac_pm_ops, | ||
2862 | }, | 2869 | }, |
2863 | .probe = davinci_emac_probe, | 2870 | .probe = davinci_emac_probe, |
2864 | .remove = __devexit_p(davinci_emac_remove), | 2871 | .remove = __devexit_p(davinci_emac_remove), |
2865 | .suspend = davinci_emac_suspend, | ||
2866 | .resume = davinci_emac_resume, | ||
2867 | }; | 2872 | }; |
2868 | 2873 | ||
2869 | /** | 2874 | /** |