Input: st1232 - switch to using SIMPLE_DEV_PM_OPS
Subsystems (3)
Dmitry Torokhov
maintainerPATCH 1/1 Input: st1232 - switch to using SIMPLE_DEV_PM_OPS
---
Just compiled, not tested...
drivers/input/touchscreen/st1232.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)
drivers/input/touchscreen/st1232.c +4 -7
@@ -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 }, };
Signature · 5 lines
1.7.7.6 -- Dmitry
Quoted 1 line · Dmitry Torokhov
Signed-off-by Dmitry Torokhov <[email protected]>
Looks good.
Quoted 47 lines
---
Just compiled, not tested...
drivers/input/touchscreen/st1232.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)drivers/input/touchscreen/st1232.c +4
-7@@ -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 }, };
Hi,
I'm not sure that I follow why st1232_ts_pm_ops is needed if CONFIG_PM_SLEEP isn't defined.
Quoted 58 lines · Dmitry Torokhov
Signed-off-by Dmitry Torokhov <[email protected]>---
Just compiled, not tested...
drivers/input/touchscreen/st1232.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)drivers/input/touchscreen/st1232.c +4
-7@@ -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 }, };Signature · 9 lines
1.7.7.6 -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov
maintainerHi Simon,
Quoted 5 lines · Simon Horman
Hi,
I'm not sure that I follow why
st1232_ts_pm_opsis needed ifCONFIG_PM_SLEEPisn't defined.
In case of !CONFIG_PM_SLEEP dev_pm_ops is an empty structure; having it allows us to drop some ifdefs.
Thanks.
Quoted 62 lines · Dmitry Torokhov
Review
Quoted 9 lines
Signed-off-by Dmitry Torokhov <[email protected]>---
Just compiled, not tested...
drivers/input/touchscreen/st1232.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)(quoted diff) +0
-0
b/drivers/input/touchscreen/st1232.cdrivers/input/touchscreen/st1232.c static int __devexit st1232_ts_remove(struct
Quoted 4 lines
index e22e27e..a9be39f 100644
drivers/input/touchscreen/st1232.c +0
-0@@ -218,7 +218,7 @@ static int __devexit st1232_ts_remove(struct
i2c_client*client)Quoted 42 lines
drivers/input/touchscreen/st1232.c +4
-7return 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 }, };Signature · 7 lines
1.7.7.6 -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-sh"in
Quoted 3 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Simon Horman
Reviewed-byQuoted 6 lines · Dmitry Torokhov
Hi Simon,
Simon Horman <[email protected]> wrote:
Quoted 7 lines
Quoted 5 lines
Hi,
I'm not sure that I follow why
st1232_ts_pm_opsis needed ifCONFIG_PM_SLEEPisn't defined.In case of !CONFIG_PM_SLEEP
dev_pm_opsis an empty structure; having it allows us to drop some ifdefs.
Thanks, understood.