* [PATCH] dm9000: switch to dev_pm_ops
@ 2009-07-21 14:00 Mike Rapoport
2009-07-21 15:04 ` Ben Dooks
0 siblings, 1 reply; 3+ messages in thread
From: Mike Rapoport @ 2009-07-21 14:00 UTC (permalink / raw)
To: David S. Miller; +Cc: Ben Dooks, netdev, Mike Rapoport
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
---
drivers/net/dm9000.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index dd771de..7b639cd 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -1410,9 +1410,10 @@ out:
}
static int
-dm9000_drv_suspend(struct platform_device *dev, pm_message_t state)
+dm9000_drv_suspend(struct device *dev)
{
- struct net_device *ndev = platform_get_drvdata(dev);
+ struct platform_device *pdev = to_platform_device(dev);
+ struct net_device *ndev = platform_get_drvdata(pdev);
board_info_t *db;
if (ndev) {
@@ -1428,9 +1429,10 @@ dm9000_drv_suspend(struct platform_device *dev, pm_message_t state)
}
static int
-dm9000_drv_resume(struct platform_device *dev)
+dm9000_drv_resume(struct device *dev)
{
- struct net_device *ndev = platform_get_drvdata(dev);
+ struct platform_device *pdev = to_platform_device(dev);
+ struct net_device *ndev = platform_get_drvdata(pdev);
board_info_t *db = netdev_priv(ndev);
if (ndev) {
@@ -1447,6 +1449,11 @@ dm9000_drv_resume(struct platform_device *dev)
return 0;
}
+static struct dev_pm_ops dm9000_drv_pm_ops = {
+ .suspend = dm9000_drv_suspend,
+ .resume = dm9000_drv_resume,
+};
+
static int __devexit
dm9000_drv_remove(struct platform_device *pdev)
{
@@ -1466,11 +1473,10 @@ static struct platform_driver dm9000_driver = {
.driver = {
.name = "dm9000",
.owner = THIS_MODULE,
+ .pm = &dm9000_drv_pm_ops,
},
.probe = dm9000_probe,
.remove = __devexit_p(dm9000_drv_remove),
- .suspend = dm9000_drv_suspend,
- .resume = dm9000_drv_resume,
};
static int __init
--
1.6.0.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dm9000: switch to dev_pm_ops
2009-07-21 14:00 [PATCH] dm9000: switch to dev_pm_ops Mike Rapoport
@ 2009-07-21 15:04 ` Ben Dooks
2009-07-21 19:37 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Ben Dooks @ 2009-07-21 15:04 UTC (permalink / raw)
To: Mike Rapoport; +Cc: David S. Miller, netdev
Mike Rapoport wrote:
> Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Ben Dooks <ben-linux@fluff.org>
> ---
> drivers/net/dm9000.c | 18 ++++++++++++------
> 1 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
> index dd771de..7b639cd 100644
> --- a/drivers/net/dm9000.c
> +++ b/drivers/net/dm9000.c
> @@ -1410,9 +1410,10 @@ out:
> }
>
> static int
> -dm9000_drv_suspend(struct platform_device *dev, pm_message_t state)
> +dm9000_drv_suspend(struct device *dev)
> {
> - struct net_device *ndev = platform_get_drvdata(dev);
> + struct platform_device *pdev = to_platform_device(dev);
> + struct net_device *ndev = platform_get_drvdata(pdev);
> board_info_t *db;
>
> if (ndev) {
> @@ -1428,9 +1429,10 @@ dm9000_drv_suspend(struct platform_device *dev, pm_message_t state)
> }
>
> static int
> -dm9000_drv_resume(struct platform_device *dev)
> +dm9000_drv_resume(struct device *dev)
> {
> - struct net_device *ndev = platform_get_drvdata(dev);
> + struct platform_device *pdev = to_platform_device(dev);
> + struct net_device *ndev = platform_get_drvdata(pdev);
> board_info_t *db = netdev_priv(ndev);
>
> if (ndev) {
> @@ -1447,6 +1449,11 @@ dm9000_drv_resume(struct platform_device *dev)
> return 0;
> }
>
> +static struct dev_pm_ops dm9000_drv_pm_ops = {
> + .suspend = dm9000_drv_suspend,
> + .resume = dm9000_drv_resume,
> +};
> +
> static int __devexit
> dm9000_drv_remove(struct platform_device *pdev)
> {
> @@ -1466,11 +1473,10 @@ static struct platform_driver dm9000_driver = {
> .driver = {
> .name = "dm9000",
> .owner = THIS_MODULE,
> + .pm = &dm9000_drv_pm_ops,
> },
> .probe = dm9000_probe,
> .remove = __devexit_p(dm9000_drv_remove),
> - .suspend = dm9000_drv_suspend,
> - .resume = dm9000_drv_resume,
> };
>
> static int __init
--
Ben Dooks, Software Engineer, Simtec Electronics
http://www.simtec.co.uk/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dm9000: switch to dev_pm_ops
2009-07-21 15:04 ` Ben Dooks
@ 2009-07-21 19:37 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-07-21 19:37 UTC (permalink / raw)
To: ben; +Cc: mike, netdev
From: Ben Dooks <ben@simtec.co.uk>
Date: Tue, 21 Jul 2009 16:04:06 +0100
> Mike Rapoport wrote:
>> Signed-off-by: Mike Rapoport <mike@compulab.co.il>
> Acked-by: Ben Dooks <ben-linux@fluff.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-21 19:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 14:00 [PATCH] dm9000: switch to dev_pm_ops Mike Rapoport
2009-07-21 15:04 ` Ben Dooks
2009-07-21 19:37 ` 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).