* [PATCH] TI DaVinci EMAC: Convert to dev_pm_ops
@ 2010-03-11 8:37 Chaithrika U S
2010-03-12 23:28 ` Kevin Hilman
0 siblings, 1 reply; 3+ messages in thread
From: Chaithrika U S @ 2010-03-11 8:37 UTC (permalink / raw)
To: netdev
Cc: davem, --cc=khilman, davinci-linux-open-source, nsekhar,
sudhakar.raj, Chaithrika U S
Migrate from the legacy PM hooks to use dev_pm_ops structure.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
---
This patch applies to Linus' kernel tree.
The fixes provided in this patch[1] are needed for EMAC driver to build.
[1]http://patchwork.kernel.org/patch/84267/
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 2526a9b..eb67fa6 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -2829,31 +2829,37 @@ static int __devexit davinci_emac_remove(struct platform_device *pdev)
return 0;
}
-static
-int davinci_emac_suspend(struct platform_device *pdev, pm_message_t state)
+static int davinci_emac_suspend(struct device *dev)
{
- struct net_device *dev = platform_get_drvdata(pdev);
+ struct platform_device *pdev = to_platform_device(dev);
+ struct net_device *ndev = platform_get_drvdata(pdev);
- if (netif_running(dev))
- emac_dev_stop(dev);
+ if (netif_running(ndev))
+ emac_dev_stop(ndev);
clk_disable(emac_clk);
return 0;
}
-static int davinci_emac_resume(struct platform_device *pdev)
+static int davinci_emac_resume(struct device *dev)
{
- struct net_device *dev = platform_get_drvdata(pdev);
+ struct platform_device *pdev = to_platform_device(dev);
+ struct net_device *ndev = platform_get_drvdata(pdev);
clk_enable(emac_clk);
- if (netif_running(dev))
- emac_dev_open(dev);
+ if (netif_running(ndev))
+ emac_dev_open(ndev);
return 0;
}
+static const struct dev_pm_ops davinci_emac_pm_ops = {
+ .suspend = davinci_emac_suspend,
+ .resume = davinci_emac_resume,
+};
+
/**
* davinci_emac_driver: EMAC platform driver structure
*/
@@ -2861,11 +2867,10 @@ static struct platform_driver davinci_emac_driver = {
.driver = {
.name = "davinci_emac",
.owner = THIS_MODULE,
+ .pm = &davinci_emac_pm_ops,
},
.probe = davinci_emac_probe,
.remove = __devexit_p(davinci_emac_remove),
- .suspend = davinci_emac_suspend,
- .resume = davinci_emac_resume,
};
/**
--
1.5.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] TI DaVinci EMAC: Convert to dev_pm_ops
2010-03-11 8:37 [PATCH] TI DaVinci EMAC: Convert to dev_pm_ops Chaithrika U S
@ 2010-03-12 23:28 ` Kevin Hilman
2010-03-15 22:48 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2010-03-12 23:28 UTC (permalink / raw)
To: Chaithrika U S; +Cc: netdev, davinci-linux-open-source, davem
Chaithrika U S <chaithrika@ti.com> writes:
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] TI DaVinci EMAC: Convert to dev_pm_ops
2010-03-12 23:28 ` Kevin Hilman
@ 2010-03-15 22:48 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-03-15 22:48 UTC (permalink / raw)
To: khilman; +Cc: chaithrika, netdev, davinci-linux-open-source
From: Kevin Hilman <khilman@deeprootsystems.com>
Date: Fri, 12 Mar 2010 15:28:47 -0800
> Chaithrika U S <chaithrika@ti.com> writes:
>
>> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-15 22:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 8:37 [PATCH] TI DaVinci EMAC: Convert to dev_pm_ops Chaithrika U S
2010-03-12 23:28 ` Kevin Hilman
2010-03-15 22:48 ` David Miller
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).