From: Michael Hennerich <michael.hennerich@analog.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Bryan Wu <cooloney@kernel.org>,
Mike Frysinger <vapier@gentoo.org>,
Dmitry Torokhov <dtor@mail.ru>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"device-drivers-devel@blackfin.uclinux.org"
<device-drivers-devel@blackfin.uclinux.org>
Subject: Re: [PATCH 1/2] Input: ad714x-i2c - Convert to dev_pm_ops
Date: Fri, 11 Feb 2011 16:15:01 +0100 [thread overview]
Message-ID: <4D555275.6020909@analog.com> (raw)
In-Reply-To: <1297437183-23648-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On 02/11/2011 04:13 PM, Mark Brown wrote:
> There is a general move to convert drivers to use dev_pm_ops rather than
> bus specific PM operations in order to facilitate core work. Do this
> conversion for ad714x-i2c.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
> drivers/input/misc/ad714x-i2c.c | 17 ++++++++---------
> 1 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c
> index 2bef8fa..e21deb1 100644
> --- a/drivers/input/misc/ad714x-i2c.c
> +++ b/drivers/input/misc/ad714x-i2c.c
> @@ -10,23 +10,23 @@
> #include <linux/i2c.h>
> #include <linux/module.h>
> #include <linux/types.h>
> +#include <linux/pm.h>
> #include "ad714x.h"
>
> #ifdef CONFIG_PM
> -static int ad714x_i2c_suspend(struct i2c_client *client, pm_message_t message)
> +static int ad714x_i2c_suspend(struct device *dev)
> {
> - return ad714x_disable(i2c_get_clientdata(client));
> + return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev)));
> }
>
> -static int ad714x_i2c_resume(struct i2c_client *client)
> +static int ad714x_i2c_resume(struct device *dev)
> {
> - return ad714x_enable(i2c_get_clientdata(client));
> + return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev)));
> }
> -#else
> -# define ad714x_i2c_suspend NULL
> -# define ad714x_i2c_resume NULL
> #endif
>
> +static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume);
> +
> static int ad714x_i2c_write(struct device *dev, unsigned short reg,
> unsigned short data)
> {
> @@ -114,11 +114,10 @@ MODULE_DEVICE_TABLE(i2c, ad714x_id);
> static struct i2c_driver ad714x_i2c_driver = {
> .driver = {
> .name = "ad714x_captouch",
> + .pm = &ad714x_i2c_pm,
> },
> .probe = ad714x_i2c_probe,
> .remove = __devexit_p(ad714x_i2c_remove),
> - .suspend = ad714x_i2c_suspend,
> - .resume = ad714x_i2c_resume,
> .id_table = ad714x_id,
> };
>
>
--
Greetings,
Michael
--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif
prev parent reply other threads:[~2011-02-11 15:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-11 15:13 [PATCH 1/2] Input: ad714x-i2c - Convert to dev_pm_ops Mark Brown
2011-02-11 15:13 ` [PATCH 2/2] Input: ad714x-spi " Mark Brown
2011-02-11 15:14 ` Michael Hennerich
2011-02-11 15:15 ` Michael Hennerich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D555275.6020909@analog.com \
--to=michael.hennerich@analog.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=cooloney@kernel.org \
--cc=device-drivers-devel@blackfin.uclinux.org \
--cc=dtor@mail.ru \
--cc=linux-input@vger.kernel.org \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.