* [PATCH] Input: st1232 - switch to using SIMPLE_DEV_PM_OPS
@ 2012-03-31 6:18 Dmitry Torokhov
2012-04-01 5:58 ` Rafael J. Wysocki
2012-04-01 23:28 ` Simon Horman
0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2012-03-31 6:18 UTC (permalink / raw)
To: Magnus Damm; +Cc: Rafael J. Wysocki, Arnd Bergmann, linux-sh, linux-input
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
Just compiled, not tested...
drivers/input/touchscreen/st1232.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index e22e27e..a9be39f 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -218,7 +218,7 @@ static int __devexit st1232_ts_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int st1232_ts_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -243,12 +243,11 @@ static int st1232_ts_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops st1232_ts_pm_ops = {
- .suspend = st1232_ts_suspend,
- .resume = st1232_ts_resume,
-};
#endif
+static SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops,
+ st1232_ts_suspend, st1232_ts_resume);
+
static const struct i2c_device_id st1232_ts_id[] = {
{ ST1232_TS_NAME, 0 },
{ }
@@ -269,9 +268,7 @@ static struct i2c_driver st1232_ts_driver = {
.name = ST1232_TS_NAME,
.owner = THIS_MODULE,
.of_match_table = st1232_ts_dt_ids,
-#ifdef CONFIG_PM
.pm = &st1232_ts_pm_ops,
-#endif
},
};
--
1.7.7.6
--
Dmitry
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: st1232 - switch to using SIMPLE_DEV_PM_OPS
2012-03-31 6:18 [PATCH] Input: st1232 - switch to using SIMPLE_DEV_PM_OPS Dmitry Torokhov
@ 2012-04-01 5:58 ` Rafael J. Wysocki
2012-04-01 23:28 ` Simon Horman
1 sibling, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2012-04-01 5:58 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Magnus Damm, Arnd Bergmann, linux-sh, linux-input
On Saturday, March 31, 2012, Dmitry Torokhov wrote:
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Looks good.
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
>
> Just compiled, not tested...
>
> drivers/input/touchscreen/st1232.c | 11 ++++-------
> 1 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
> index e22e27e..a9be39f 100644
> --- a/drivers/input/touchscreen/st1232.c
> +++ b/drivers/input/touchscreen/st1232.c
> @@ -218,7 +218,7 @@ static int __devexit st1232_ts_remove(struct i2c_client *client)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
> static int st1232_ts_suspend(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
> @@ -243,12 +243,11 @@ static int st1232_ts_resume(struct device *dev)
> return 0;
> }
>
> -static const struct dev_pm_ops st1232_ts_pm_ops = {
> - .suspend = st1232_ts_suspend,
> - .resume = st1232_ts_resume,
> -};
> #endif
>
> +static SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops,
> + st1232_ts_suspend, st1232_ts_resume);
> +
> static const struct i2c_device_id st1232_ts_id[] = {
> { ST1232_TS_NAME, 0 },
> { }
> @@ -269,9 +268,7 @@ static struct i2c_driver st1232_ts_driver = {
> .name = ST1232_TS_NAME,
> .owner = THIS_MODULE,
> .of_match_table = st1232_ts_dt_ids,
> -#ifdef CONFIG_PM
> .pm = &st1232_ts_pm_ops,
> -#endif
> },
> };
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: st1232 - switch to using SIMPLE_DEV_PM_OPS
2012-03-31 6:18 [PATCH] Input: st1232 - switch to using SIMPLE_DEV_PM_OPS Dmitry Torokhov
2012-04-01 5:58 ` Rafael J. Wysocki
@ 2012-04-01 23:28 ` Simon Horman
2012-04-02 0:41 ` Dmitry Torokhov
1 sibling, 1 reply; 5+ messages in thread
From: Simon Horman @ 2012-04-01 23:28 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Magnus Damm, Rafael J. Wysocki, Arnd Bergmann, linux-sh,
linux-input
Hi,
I'm not sure that I follow why st1232_ts_pm_ops is needed
if CONFIG_PM_SLEEP isn't defined.
On Fri, Mar 30, 2012 at 11:18:02PM -0700, Dmitry Torokhov wrote:
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
>
> Just compiled, not tested...
>
> drivers/input/touchscreen/st1232.c | 11 ++++-------
> 1 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
> index e22e27e..a9be39f 100644
> --- a/drivers/input/touchscreen/st1232.c
> +++ b/drivers/input/touchscreen/st1232.c
> @@ -218,7 +218,7 @@ static int __devexit st1232_ts_remove(struct i2c_client *client)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
> static int st1232_ts_suspend(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
> @@ -243,12 +243,11 @@ static int st1232_ts_resume(struct device *dev)
> return 0;
> }
>
> -static const struct dev_pm_ops st1232_ts_pm_ops = {
> - .suspend = st1232_ts_suspend,
> - .resume = st1232_ts_resume,
> -};
> #endif
>
> +static SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops,
> + st1232_ts_suspend, st1232_ts_resume);
> +
> static const struct i2c_device_id st1232_ts_id[] = {
> { ST1232_TS_NAME, 0 },
> { }
> @@ -269,9 +268,7 @@ static struct i2c_driver st1232_ts_driver = {
> .name = ST1232_TS_NAME,
> .owner = THIS_MODULE,
> .of_match_table = st1232_ts_dt_ids,
> -#ifdef CONFIG_PM
> .pm = &st1232_ts_pm_ops,
> -#endif
> },
> };
>
> --
> 1.7.7.6
>
>
> --
> Dmitry
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: st1232 - switch to using SIMPLE_DEV_PM_OPS
2012-04-01 23:28 ` Simon Horman
@ 2012-04-02 0:41 ` Dmitry Torokhov
2012-04-02 5:03 ` Simon Horman
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2012-04-02 0:41 UTC (permalink / raw)
To: Simon Horman
Cc: Magnus Damm, Rafael J. Wysocki, Arnd Bergmann, linux-sh,
linux-input
Hi Simon,
Simon Horman <horms@verge.net.au> wrote:
>Hi,
>
>I'm not sure that I follow why st1232_ts_pm_ops is needed
>if CONFIG_PM_SLEEP isn't defined.
>
In case of !CONFIG_PM_SLEEP dev_pm_ops is an empty structure; having it allows us to drop some ifdefs.
Thanks.
>On Fri, Mar 30, 2012 at 11:18:02PM -0700, Dmitry Torokhov wrote:
>> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
>> ---
>>
>> Just compiled, not tested...
>>
>> drivers/input/touchscreen/st1232.c | 11 ++++-------
>> 1 files changed, 4 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/input/touchscreen/st1232.c
>b/drivers/input/touchscreen/st1232.c
>> index e22e27e..a9be39f 100644
>> --- a/drivers/input/touchscreen/st1232.c
>> +++ b/drivers/input/touchscreen/st1232.c
>> @@ -218,7 +218,7 @@ static int __devexit st1232_ts_remove(struct
>i2c_client *client)
>> return 0;
>> }
>>
>> -#ifdef CONFIG_PM
>> +#ifdef CONFIG_PM_SLEEP
>> static int st1232_ts_suspend(struct device *dev)
>> {
>> struct i2c_client *client = to_i2c_client(dev);
>> @@ -243,12 +243,11 @@ static int st1232_ts_resume(struct device *dev)
>> return 0;
>> }
>>
>> -static const struct dev_pm_ops st1232_ts_pm_ops = {
>> - .suspend = st1232_ts_suspend,
>> - .resume = st1232_ts_resume,
>> -};
>> #endif
>>
>> +static SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops,
>> + st1232_ts_suspend, st1232_ts_resume);
>> +
>> static const struct i2c_device_id st1232_ts_id[] = {
>> { ST1232_TS_NAME, 0 },
>> { }
>> @@ -269,9 +268,7 @@ static struct i2c_driver st1232_ts_driver = {
>> .name = ST1232_TS_NAME,
>> .owner = THIS_MODULE,
>> .of_match_table = st1232_ts_dt_ids,
>> -#ifdef CONFIG_PM
>> .pm = &st1232_ts_pm_ops,
>> -#endif
>> },
>> };
>>
>> --
>> 1.7.7.6
>>
>>
>> --
>> Dmitry
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-sh"
>in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: st1232 - switch to using SIMPLE_DEV_PM_OPS
2012-04-02 0:41 ` Dmitry Torokhov
@ 2012-04-02 5:03 ` Simon Horman
0 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2012-04-02 5:03 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Magnus Damm, Rafael J. Wysocki, Arnd Bergmann, linux-sh,
linux-input
On Sun, Apr 01, 2012 at 05:41:40PM -0700, Dmitry Torokhov wrote:
>
>
> Hi Simon,
>
> Simon Horman <horms@verge.net.au> wrote:
>
> >Hi,
> >
> >I'm not sure that I follow why st1232_ts_pm_ops is needed
> >if CONFIG_PM_SLEEP isn't defined.
> >
>
> In case of !CONFIG_PM_SLEEP dev_pm_ops is an empty structure; having it allows us to drop some ifdefs.
Thanks, understood.
Reviewed-by: Simon Horman <horms@verge.net.au>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-04-02 5:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-31 6:18 [PATCH] Input: st1232 - switch to using SIMPLE_DEV_PM_OPS Dmitry Torokhov
2012-04-01 5:58 ` Rafael J. Wysocki
2012-04-01 23:28 ` Simon Horman
2012-04-02 0:41 ` Dmitry Torokhov
2012-04-02 5:03 ` Simon Horman
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).