lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200911291619.11808.rjw@sisk.pl>
Date:	Sun, 29 Nov 2009 16:19:11 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Kevin Hilman <khilman@...prootsystems.com>
Cc:	Nicolas Pitre <nico@...xnic.net>,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] NET: smc91x: convert to dev_pm_ops

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@...prootsystems.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,
>  	},
>  };
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ