netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NET: smc91x: convert to dev_pm_ops
@ 2009-11-24 22:57 Kevin Hilman
  2009-11-25  1:13 ` Nicolas Pitre
  2009-11-29 15:19 ` Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Hilman @ 2009-11-24 22:57 UTC (permalink / raw)
  To: Nicolas Pitre, David S. Miller, netdev; +Cc: linux-kernel

Convert smc91x driver from legacy PM hooks over to using dev_pm_ops.

Tested on OMAP3 platform.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 drivers/net/smc91x.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 05c91ee..8e4c455 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
+static int smc_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);
 
 	if (ndev) {
 		if (netif_running(ndev)) {
@@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
 	return 0;
 }
 
-static int smc_drv_resume(struct platform_device *dev)
+static int smc_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);
 
 	if (ndev) {
 		struct smc_local *lp = netdev_priv(ndev);
@@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev)
 	return 0;
 }
 
+static struct dev_pm_ops smc_drv_pm_ops = {
+	.suspend	= smc_drv_suspend,
+	.resume		= smc_drv_resume,
+};
+
 static struct platform_driver smc_driver = {
 	.probe		= smc_drv_probe,
 	.remove		= __devexit_p(smc_drv_remove),
-	.suspend	= smc_drv_suspend,
-	.resume		= smc_drv_resume,
 	.driver		= {
 		.name	= CARDNAME,
 		.owner	= THIS_MODULE,
+		.pm	= &smc_drv_pm_ops,
 	},
 };
 
-- 
1.6.5.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] NET: smc91x: convert to dev_pm_ops
  2009-11-24 22:57 [PATCH] NET: smc91x: convert to dev_pm_ops Kevin Hilman
@ 2009-11-25  1:13 ` Nicolas Pitre
  2009-11-29  8:21   ` David Miller
  2009-11-29 15:19 ` Rafael J. Wysocki
  1 sibling, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2009-11-25  1:13 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: David S. Miller, netdev, linux-kernel

On Tue, 24 Nov 2009, Kevin Hilman wrote:

> Convert smc91x driver from legacy PM hooks over to using dev_pm_ops.
> 
> Tested on OMAP3 platform.
> 
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>

Acked-by: Nicolas Pitre <nico@fluxnic.net>


> ---
>  drivers/net/smc91x.c |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
> index 05c91ee..8e4c455 100644
> --- a/drivers/net/smc91x.c
> +++ b/drivers/net/smc91x.c
> @@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
> +static int smc_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);
>  
>  	if (ndev) {
>  		if (netif_running(ndev)) {
> @@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
>  	return 0;
>  }
>  
> -static int smc_drv_resume(struct platform_device *dev)
> +static int smc_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);
>  
>  	if (ndev) {
>  		struct smc_local *lp = netdev_priv(ndev);
> @@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev)
>  	return 0;
>  }
>  
> +static struct dev_pm_ops smc_drv_pm_ops = {
> +	.suspend	= smc_drv_suspend,
> +	.resume		= smc_drv_resume,
> +};
> +
>  static struct platform_driver smc_driver = {
>  	.probe		= smc_drv_probe,
>  	.remove		= __devexit_p(smc_drv_remove),
> -	.suspend	= smc_drv_suspend,
> -	.resume		= smc_drv_resume,
>  	.driver		= {
>  		.name	= CARDNAME,
>  		.owner	= THIS_MODULE,
> +		.pm	= &smc_drv_pm_ops,
>  	},
>  };
>  
> -- 
> 1.6.5.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NET: smc91x: convert to dev_pm_ops
  2009-11-25  1:13 ` Nicolas Pitre
@ 2009-11-29  8:21   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-11-29  8:21 UTC (permalink / raw)
  To: nico; +Cc: khilman, netdev, linux-kernel

From: Nicolas Pitre <nico@fluxnic.net>
Date: Tue, 24 Nov 2009 20:13:15 -0500 (EST)

> On Tue, 24 Nov 2009, Kevin Hilman wrote:
> 
>> Convert smc91x driver from legacy PM hooks over to using dev_pm_ops.
>> 
>> Tested on OMAP3 platform.
>> 
>> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> 
> Acked-by: Nicolas Pitre <nico@fluxnic.net>

Applied to net-next-2.6, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NET: smc91x: convert to dev_pm_ops
  2009-11-24 22:57 [PATCH] NET: smc91x: convert to dev_pm_ops Kevin Hilman
  2009-11-25  1:13 ` Nicolas Pitre
@ 2009-11-29 15:19 ` Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2009-11-29 15:19 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Nicolas Pitre, David S. Miller, netdev, linux-kernel

On Tuesday 24 November 2009, Kevin Hilman wrote:
> Convert smc91x driver from legacy PM hooks over to using dev_pm_ops.
> 
> Tested on OMAP3 platform.

It seems to be missing the hibernation hooks, at least .freeze() and .restore(),
but I guess .thaw() as well.

> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>

Thanks (and sorry for the late response),
Rafael


> ---
>  drivers/net/smc91x.c |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
> index 05c91ee..8e4c455 100644
> --- a/drivers/net/smc91x.c
> +++ b/drivers/net/smc91x.c
> @@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
> +static int smc_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);
>  
>  	if (ndev) {
>  		if (netif_running(ndev)) {
> @@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
>  	return 0;
>  }
>  
> -static int smc_drv_resume(struct platform_device *dev)
> +static int smc_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);
>  
>  	if (ndev) {
>  		struct smc_local *lp = netdev_priv(ndev);
> @@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev)
>  	return 0;
>  }
>  
> +static struct dev_pm_ops smc_drv_pm_ops = {
> +	.suspend	= smc_drv_suspend,
> +	.resume		= smc_drv_resume,
> +};
> +
>  static struct platform_driver smc_driver = {
>  	.probe		= smc_drv_probe,
>  	.remove		= __devexit_p(smc_drv_remove),
> -	.suspend	= smc_drv_suspend,
> -	.resume		= smc_drv_resume,
>  	.driver		= {
>  		.name	= CARDNAME,
>  		.owner	= THIS_MODULE,
> +		.pm	= &smc_drv_pm_ops,
>  	},
>  };

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-29 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24 22:57 [PATCH] NET: smc91x: convert to dev_pm_ops Kevin Hilman
2009-11-25  1:13 ` Nicolas Pitre
2009-11-29  8:21   ` David Miller
2009-11-29 15:19 ` Rafael J. Wysocki

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).