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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 12 Jul 2012 11:24:54 +0800 (CST)
From:	guanxuetao@...c.pku.edu.cn
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	"LKML" <linux-kernel@...r.kernel.org>,
	"Linux PM list" <linux-pm@...r.kernel.org>,
	"Linus Walleij" <linus.walleij@...ricsson.com>,
	linux-i2c@...r.kernel.org, "Sonic Zhang" <sonic.zhang@...log.com>,
	"Jean Delvare" <khali@...ux-fr.org>,
	"Ben Dooks" <ben-linux@...ff.org>,
	"Wolfram Sang" <w.sang@...gutronix.de>,
	"Peter Korsgaard" <jacmet@...site.dk>,
	"Guan Xuetao" <gxt@...c.pku.edu.cn>,
	"Vitaly Wool" <vitalywool@...il.com>,
	"Colin Cross" <ccross@...roid.com>,
	"Stephen Warren" <swarren@...dotorg.org>
Subject: Re: [PATCH 5/7] i2c-puv3: Use struct dev_pm_ops for power 
     management

> From: Rafael J. Wysocki <rjw@...k.pl>
>
> Make the PKUnity-v3 SoC I2C controller driver define its suspend
> callback through a struct dev_pm_ops object rather than by using
> a legacy PM hook in struct platform_driver.  The empty resume
> callback is not necessary, so remove it.
>
> Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>

Thanks.

Acked-by: Guan Xuetao <gxt@...c.pku.edu.cn>

> ---
>  drivers/i2c/busses/i2c-puv3.c |   15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
>
> Index: linux/drivers/i2c/busses/i2c-puv3.c
> ===================================================================
> --- linux.orig/drivers/i2c/busses/i2c-puv3.c
> +++ linux/drivers/i2c/busses/i2c-puv3.c
> @@ -254,7 +254,7 @@ static int __devexit puv3_i2c_remove(str
>  }
>
>  #ifdef CONFIG_PM
> -static int puv3_i2c_suspend(struct platform_device *dev, pm_message_t
> state)
> +static int puv3_i2c_suspend(struct device *dev)
>  {
>  	int poll_count;
>  	/* Disable the IIC */
> @@ -267,23 +267,20 @@ static int puv3_i2c_suspend(struct platf
>  	return 0;
>  }
>
> -static int puv3_i2c_resume(struct platform_device *dev)
> -{
> -	return 0 ;
> -}
> +static SIMPLE_DEV_PM_OPS(puv3_i2c_pm, puv3_i2c_suspend, NULL);
> +#define PUV3_I2C_PM	(&puv3_i2c_pm)
> +
>  #else
> -#define puv3_i2c_suspend NULL
> -#define puv3_i2c_resume NULL
> +#define PUV3_I2C_PM	NULL
>  #endif
>
>  static struct platform_driver puv3_i2c_driver = {
>  	.probe		= puv3_i2c_probe,
>  	.remove		= __devexit_p(puv3_i2c_remove),
> -	.suspend	= puv3_i2c_suspend,
> -	.resume		= puv3_i2c_resume,
>  	.driver		= {
>  		.name	= "PKUnity-v3-I2C",
>  		.owner	= THIS_MODULE,
> +		.pm	= PUV3_I2C_PM,
>  	}
>  };
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ