From 458d7343fe0f37362521cace6b561f36eb3fc97c Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:03 +0000 Subject: Input: ad7877 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Michael Hennerich Acked-by: Michael Hennerich Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-31-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ad7877.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index 08f5372f0bfd..edb36d663f22 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -788,7 +788,7 @@ static int ad7877_probe(struct spi_device *spi) return 0; } -static int __maybe_unused ad7877_suspend(struct device *dev) +static int ad7877_suspend(struct device *dev) { struct ad7877 *ts = dev_get_drvdata(dev); @@ -797,7 +797,7 @@ static int __maybe_unused ad7877_suspend(struct device *dev) return 0; } -static int __maybe_unused ad7877_resume(struct device *dev) +static int ad7877_resume(struct device *dev) { struct ad7877 *ts = dev_get_drvdata(dev); @@ -806,12 +806,12 @@ static int __maybe_unused ad7877_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume); static struct spi_driver ad7877_driver = { .driver = { .name = "ad7877", - .pm = &ad7877_pm, + .pm = pm_sleep_ptr(&ad7877_pm), }, .probe = ad7877_probe, }; -- cgit v1.2.3 From f8909d9a8b4569f871034ab3f2bc4261135c5b86 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:04 +0000 Subject: Input: ads7846 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-32-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ads7846.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index bed68a68f330..4c3dd01902d0 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -944,7 +944,7 @@ static irqreturn_t ads7846_irq(int irq, void *handle) return IRQ_HANDLED; } -static int __maybe_unused ads7846_suspend(struct device *dev) +static int ads7846_suspend(struct device *dev) { struct ads7846 *ts = dev_get_drvdata(dev); @@ -966,7 +966,7 @@ static int __maybe_unused ads7846_suspend(struct device *dev) return 0; } -static int __maybe_unused ads7846_resume(struct device *dev) +static int ads7846_resume(struct device *dev) { struct ads7846 *ts = dev_get_drvdata(dev); @@ -988,7 +988,7 @@ static int __maybe_unused ads7846_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); static int ads7846_setup_pendown(struct spi_device *spi, struct ads7846 *ts, @@ -1421,7 +1421,7 @@ static void ads7846_remove(struct spi_device *spi) static struct spi_driver ads7846_driver = { .driver = { .name = "ads7846", - .pm = &ads7846_pm, + .pm = pm_sleep_ptr(&ads7846_pm), .of_match_table = of_match_ptr(ads7846_dt_ids), }, .probe = ads7846_probe, -- cgit v1.2.3 From eb6abb8962b30b36b4bcb47faaa1325937300389 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:05 +0000 Subject: Input: ar1021 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-33-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ar1021_i2c.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c index 25bcc677e98b..3a5b65cae360 100644 --- a/drivers/input/touchscreen/ar1021_i2c.c +++ b/drivers/input/touchscreen/ar1021_i2c.c @@ -142,7 +142,7 @@ static int ar1021_i2c_probe(struct i2c_client *client) return 0; } -static int __maybe_unused ar1021_i2c_suspend(struct device *dev) +static int ar1021_i2c_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -151,7 +151,7 @@ static int __maybe_unused ar1021_i2c_suspend(struct device *dev) return 0; } -static int __maybe_unused ar1021_i2c_resume(struct device *dev) +static int ar1021_i2c_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -160,7 +160,8 @@ static int __maybe_unused ar1021_i2c_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ar1021_i2c_pm, ar1021_i2c_suspend, ar1021_i2c_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ar1021_i2c_pm, + ar1021_i2c_suspend, ar1021_i2c_resume); static const struct i2c_device_id ar1021_i2c_id[] = { { "ar1021", 0 }, @@ -177,7 +178,7 @@ MODULE_DEVICE_TABLE(of, ar1021_i2c_of_match); static struct i2c_driver ar1021_i2c_driver = { .driver = { .name = "ar1021_i2c", - .pm = &ar1021_i2c_pm, + .pm = pm_sleep_ptr(&ar1021_i2c_pm), .of_match_table = ar1021_i2c_of_match, }, -- cgit v1.2.3 From 3de717d137a8d4050d9b8f75e2ee61468f24e396 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:06 +0000 Subject: Input: atmel_mxt_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Claudiu Beznea Reviewed-by: Claudiu Beznea Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-34-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/atmel_mxt_ts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 39ef2664b852..996bf434e1cb 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3296,7 +3296,7 @@ static void mxt_remove(struct i2c_client *client) data->regulators); } -static int __maybe_unused mxt_suspend(struct device *dev) +static int mxt_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct mxt_data *data = i2c_get_clientdata(client); @@ -3317,7 +3317,7 @@ static int __maybe_unused mxt_suspend(struct device *dev) return 0; } -static int __maybe_unused mxt_resume(struct device *dev) +static int mxt_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct mxt_data *data = i2c_get_clientdata(client); @@ -3338,7 +3338,7 @@ static int __maybe_unused mxt_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume); static const struct of_device_id mxt_of_match[] = { { .compatible = "atmel,maxtouch", }, @@ -3375,7 +3375,7 @@ static struct i2c_driver mxt_driver = { .name = "atmel_mxt_ts", .of_match_table = mxt_of_match, .acpi_match_table = ACPI_PTR(mxt_acpi_id), - .pm = &mxt_pm_ops, + .pm = pm_sleep_ptr(&mxt_pm_ops), }, .probe_new = mxt_probe, .remove = mxt_remove, -- cgit v1.2.3 From 48877f8e7a0694c8668a840f4d4fd6aafd088109 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:07 +0000 Subject: Input: auo-pixcir-ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Heiko Stuebner Reviewed-by: Heiko Stuebner Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-35-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/auo-pixcir-ts.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c index a4a1d58aeeac..5359efc80b2b 100644 --- a/drivers/input/touchscreen/auo-pixcir-ts.c +++ b/drivers/input/touchscreen/auo-pixcir-ts.c @@ -410,7 +410,7 @@ static void auo_pixcir_input_close(struct input_dev *dev) auo_pixcir_stop(ts); } -static int __maybe_unused auo_pixcir_suspend(struct device *dev) +static int auo_pixcir_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct auo_pixcir_ts *ts = i2c_get_clientdata(client); @@ -442,7 +442,7 @@ unlock: return ret; } -static int __maybe_unused auo_pixcir_resume(struct device *dev) +static int auo_pixcir_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct auo_pixcir_ts *ts = i2c_get_clientdata(client); @@ -472,8 +472,8 @@ unlock: return ret; } -static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, - auo_pixcir_suspend, auo_pixcir_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, + auo_pixcir_suspend, auo_pixcir_resume); static void auo_pixcir_reset(void *data) { @@ -633,7 +633,7 @@ MODULE_DEVICE_TABLE(of, auo_pixcir_ts_dt_idtable); static struct i2c_driver auo_pixcir_driver = { .driver = { .name = "auo_pixcir_ts", - .pm = &auo_pixcir_pm_ops, + .pm = pm_sleep_ptr(&auo_pixcir_pm_ops), .of_match_table = of_match_ptr(auo_pixcir_ts_dt_idtable), }, .probe_new = auo_pixcir_probe, -- cgit v1.2.3 From bed5cf8f007d2b9503aa8d5a6928c5059a2a4d2e Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:08 +0000 Subject: Input: bu21013_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-36-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/bu21013_ts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index 5a4dbd39a372..c994ab6f4e58 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c @@ -560,7 +560,7 @@ static void bu21013_remove(struct i2c_client *client) /* The resources will be freed by devm */ } -static int __maybe_unused bu21013_suspend(struct device *dev) +static int bu21013_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct bu21013_ts *ts = i2c_get_clientdata(client); @@ -575,7 +575,7 @@ static int __maybe_unused bu21013_suspend(struct device *dev) return 0; } -static int __maybe_unused bu21013_resume(struct device *dev) +static int bu21013_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct bu21013_ts *ts = i2c_get_clientdata(client); @@ -604,7 +604,7 @@ static int __maybe_unused bu21013_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume); static const struct i2c_device_id bu21013_id[] = { { DRIVER_TP, 0 }, @@ -615,7 +615,7 @@ MODULE_DEVICE_TABLE(i2c, bu21013_id); static struct i2c_driver bu21013_driver = { .driver = { .name = DRIVER_TP, - .pm = &bu21013_dev_pm_ops, + .pm = pm_sleep_ptr(&bu21013_dev_pm_ops), }, .probe_new = bu21013_probe, .remove = bu21013_remove, -- cgit v1.2.3 From a259afe95f2ef0264b2fd78238acb418d9aaea02 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:09 +0000 Subject: Input: bu21029 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Zhu Yi Cc: Mark Jonas Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-37-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/bu21029_ts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/bu21029_ts.c b/drivers/input/touchscreen/bu21029_ts.c index 215f4dc5105d..8f1442894ff9 100644 --- a/drivers/input/touchscreen/bu21029_ts.c +++ b/drivers/input/touchscreen/bu21029_ts.c @@ -422,7 +422,7 @@ static int bu21029_probe(struct i2c_client *client) return 0; } -static int __maybe_unused bu21029_suspend(struct device *dev) +static int bu21029_suspend(struct device *dev) { struct i2c_client *i2c = to_i2c_client(dev); struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c); @@ -437,7 +437,7 @@ static int __maybe_unused bu21029_suspend(struct device *dev) return 0; } -static int __maybe_unused bu21029_resume(struct device *dev) +static int bu21029_resume(struct device *dev) { struct i2c_client *i2c = to_i2c_client(dev); struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c); @@ -451,7 +451,7 @@ static int __maybe_unused bu21029_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(bu21029_pm_ops, bu21029_suspend, bu21029_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bu21029_pm_ops, bu21029_suspend, bu21029_resume); static const struct i2c_device_id bu21029_ids[] = { { DRIVER_NAME, 0 }, @@ -471,7 +471,7 @@ static struct i2c_driver bu21029_driver = { .driver = { .name = DRIVER_NAME, .of_match_table = of_match_ptr(bu21029_of_ids), - .pm = &bu21029_pm_ops, + .pm = pm_sleep_ptr(&bu21029_pm_ops), }, .id_table = bu21029_ids, .probe_new = bu21029_probe, -- cgit v1.2.3 From eb36403d2f32191671dc4f00cabb2cf89f64e292 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:10 +0000 Subject: Input: chipone_in8318 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the #ifdef guards. Signed-off-by: Jonathan Cameron Cc: Hans de Goede Reviewed-by: Hans de Goede Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-38-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/chipone_icn8318.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/chipone_icn8318.c b/drivers/input/touchscreen/chipone_icn8318.c index f6769e4bd4f2..32b714a6ed2d 100644 --- a/drivers/input/touchscreen/chipone_icn8318.c +++ b/drivers/input/touchscreen/chipone_icn8318.c @@ -148,7 +148,6 @@ static void icn8318_stop(struct input_dev *dev) gpiod_set_value_cansleep(data->wake_gpio, 0); } -#ifdef CONFIG_PM_SLEEP static int icn8318_suspend(struct device *dev) { struct icn8318_data *data = i2c_get_clientdata(to_i2c_client(dev)); @@ -172,9 +171,8 @@ static int icn8318_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume); static int icn8318_probe(struct i2c_client *client) { @@ -263,7 +261,7 @@ MODULE_DEVICE_TABLE(i2c, icn8318_i2c_id); static struct i2c_driver icn8318_driver = { .driver = { .name = "chipone_icn8318", - .pm = &icn8318_pm_ops, + .pm = pm_sleep_ptr(&icn8318_pm_ops), .of_match_table = icn8318_of_match, }, .probe_new = icn8318_probe, -- cgit v1.2.3 From 99e93cc9677d36efec5aec999114551419705c37 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:11 +0000 Subject: Input: chipone_icn8505 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Hans de Goede Reviewed-by: Hans de Goede Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-39-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/chipone_icn8505.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/chipone_icn8505.c b/drivers/input/touchscreen/chipone_icn8505.c index c421f4be2700..246bee0bee53 100644 --- a/drivers/input/touchscreen/chipone_icn8505.c +++ b/drivers/input/touchscreen/chipone_icn8505.c @@ -460,7 +460,7 @@ static int icn8505_probe(struct i2c_client *client) return 0; } -static int __maybe_unused icn8505_suspend(struct device *dev) +static int icn8505_suspend(struct device *dev) { struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev)); @@ -471,7 +471,7 @@ static int __maybe_unused icn8505_suspend(struct device *dev) return 0; } -static int __maybe_unused icn8505_resume(struct device *dev) +static int icn8505_resume(struct device *dev) { struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev)); int error; @@ -484,7 +484,7 @@ static int __maybe_unused icn8505_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume); static const struct acpi_device_id icn8505_acpi_match[] = { { "CHPN0001" }, @@ -495,7 +495,7 @@ MODULE_DEVICE_TABLE(acpi, icn8505_acpi_match); static struct i2c_driver icn8505_driver = { .driver = { .name = "chipone_icn8505", - .pm = &icn8505_pm_ops, + .pm = pm_sleep_ptr(&icn8505_pm_ops), .acpi_match_table = icn8505_acpi_match, }, .probe_new = icn8505_probe, -- cgit v1.2.3 From 0299859083cf097cfdfd82c5dd0ff64fc6390159 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:12 +0000 Subject: Input: cy8ctma140 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-40-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/cy8ctma140.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/cy8ctma140.c b/drivers/input/touchscreen/cy8ctma140.c index 3a91d948b7f6..cd86477d971a 100644 --- a/drivers/input/touchscreen/cy8ctma140.c +++ b/drivers/input/touchscreen/cy8ctma140.c @@ -296,7 +296,7 @@ static int cy8ctma140_probe(struct i2c_client *client) return 0; } -static int __maybe_unused cy8ctma140_suspend(struct device *dev) +static int cy8ctma140_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct cy8ctma140 *ts = i2c_get_clientdata(client); @@ -307,7 +307,7 @@ static int __maybe_unused cy8ctma140_suspend(struct device *dev) return 0; } -static int __maybe_unused cy8ctma140_resume(struct device *dev) +static int cy8ctma140_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct cy8ctma140 *ts = i2c_get_clientdata(client); @@ -322,7 +322,8 @@ static int __maybe_unused cy8ctma140_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(cy8ctma140_pm, cy8ctma140_suspend, cy8ctma140_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(cy8ctma140_pm, + cy8ctma140_suspend, cy8ctma140_resume); static const struct i2c_device_id cy8ctma140_idtable[] = { { CY8CTMA140_NAME, 0 }, @@ -339,7 +340,7 @@ MODULE_DEVICE_TABLE(of, cy8ctma140_of_match); static struct i2c_driver cy8ctma140_driver = { .driver = { .name = CY8CTMA140_NAME, - .pm = &cy8ctma140_pm, + .pm = pm_sleep_ptr(&cy8ctma140_pm), .of_match_table = cy8ctma140_of_match, }, .id_table = cy8ctma140_idtable, -- cgit v1.2.3 From c5aa5183414141b4ec5292b07b460eefed7c6e76 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:13 +0000 Subject: Input: cy8ctmg110_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-41-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/cy8ctmg110_ts.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index 7c2b7309dbaf..dcf50fbf6dc7 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c @@ -237,7 +237,7 @@ static int cy8ctmg110_probe(struct i2c_client *client) return 0; } -static int __maybe_unused cy8ctmg110_suspend(struct device *dev) +static int cy8ctmg110_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct cy8ctmg110 *ts = i2c_get_clientdata(client); @@ -250,7 +250,7 @@ static int __maybe_unused cy8ctmg110_suspend(struct device *dev) return 0; } -static int __maybe_unused cy8ctmg110_resume(struct device *dev) +static int cy8ctmg110_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct cy8ctmg110 *ts = i2c_get_clientdata(client); @@ -263,7 +263,8 @@ static int __maybe_unused cy8ctmg110_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, + cy8ctmg110_suspend, cy8ctmg110_resume); static const struct i2c_device_id cy8ctmg110_idtable[] = { { CY8CTMG110_DRIVER_NAME, 1 }, @@ -275,7 +276,7 @@ MODULE_DEVICE_TABLE(i2c, cy8ctmg110_idtable); static struct i2c_driver cy8ctmg110_driver = { .driver = { .name = CY8CTMG110_DRIVER_NAME, - .pm = &cy8ctmg110_pm, + .pm = pm_sleep_ptr(&cy8ctmg110_pm), }, .id_table = cy8ctmg110_idtable, .probe_new = cy8ctmg110_probe, -- cgit v1.2.3 From 6e6ebfc54e54bea6c5a28ce08b5460309ff96a3c Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:14 +0000 Subject: Input: edt-ft5x06 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Michael Trimarchi Cc: Dario Binacchi Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-42-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/edt-ft5x06.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index ddd0f1f62458..d09bfeaa7da6 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1353,7 +1353,7 @@ static void edt_ft5x06_ts_remove(struct i2c_client *client) edt_ft5x06_ts_teardown_debugfs(tsdata); } -static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev) +static int edt_ft5x06_ts_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); @@ -1396,7 +1396,7 @@ static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev) return 0; } -static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev) +static int edt_ft5x06_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); @@ -1459,8 +1459,8 @@ static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev) return ret; } -static SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops, - edt_ft5x06_ts_suspend, edt_ft5x06_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops, + edt_ft5x06_ts_suspend, edt_ft5x06_ts_resume); static const struct edt_i2c_chip_data edt_ft5x06_data = { .max_support_points = 5, @@ -1500,7 +1500,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = { .driver = { .name = "edt_ft5x06", .of_match_table = edt_ft5x06_of_match, - .pm = &edt_ft5x06_ts_pm_ops, + .pm = pm_sleep_ptr(&edt_ft5x06_ts_pm_ops), .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .id_table = edt_ft5x06_ts_id, -- cgit v1.2.3 From 993d854c8a065800c2f9e2fbaafb40918ebb44d7 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:15 +0000 Subject: Input: eeti_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Daniel Mack Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-43-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/eeti_ts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c index c8ab03f49227..56fa21688bdb 100644 --- a/drivers/input/touchscreen/eeti_ts.c +++ b/drivers/input/touchscreen/eeti_ts.c @@ -232,7 +232,7 @@ static int eeti_ts_probe(struct i2c_client *client) return 0; } -static int __maybe_unused eeti_ts_suspend(struct device *dev) +static int eeti_ts_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct eeti_ts *eeti = i2c_get_clientdata(client); @@ -251,7 +251,7 @@ static int __maybe_unused eeti_ts_suspend(struct device *dev) return 0; } -static int __maybe_unused eeti_ts_resume(struct device *dev) +static int eeti_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct eeti_ts *eeti = i2c_get_clientdata(client); @@ -270,7 +270,7 @@ static int __maybe_unused eeti_ts_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume); static const struct i2c_device_id eeti_ts_id[] = { { "eeti_ts", 0 }, @@ -288,7 +288,7 @@ static const struct of_device_id of_eeti_ts_match[] = { static struct i2c_driver eeti_ts_driver = { .driver = { .name = "eeti_ts", - .pm = &eeti_ts_pm, + .pm = pm_sleep_ptr(&eeti_ts_pm), .of_match_table = of_match_ptr(of_eeti_ts_match), }, .probe_new = eeti_ts_probe, -- cgit v1.2.3 From d67c047e1d9988b0605c44bf279f06e15343c3f9 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:16 +0000 Subject: Input: egalax_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-44-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/egalax_ts.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 742d47a75ac1..1a9805938e6d 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c @@ -223,7 +223,7 @@ static const struct i2c_device_id egalax_ts_id[] = { }; MODULE_DEVICE_TABLE(i2c, egalax_ts_id); -static int __maybe_unused egalax_ts_suspend(struct device *dev) +static int egalax_ts_suspend(struct device *dev) { static const u8 suspend_cmd[MAX_I2C_DATA_LEN] = { 0x3, 0x6, 0xa, 0x3, 0x36, 0x3f, 0x2, 0, 0, 0 @@ -238,7 +238,7 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev) return ret > 0 ? 0 : ret; } -static int __maybe_unused egalax_ts_resume(struct device *dev) +static int egalax_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -248,7 +248,8 @@ static int __maybe_unused egalax_ts_resume(struct device *dev) return egalax_wake_up_device(client); } -static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, + egalax_ts_suspend, egalax_ts_resume); static const struct of_device_id egalax_ts_dt_ids[] = { { .compatible = "eeti,egalax_ts" }, @@ -259,7 +260,7 @@ MODULE_DEVICE_TABLE(of, egalax_ts_dt_ids); static struct i2c_driver egalax_ts_driver = { .driver = { .name = "egalax_ts", - .pm = &egalax_ts_pm_ops, + .pm = pm_sleep_ptr(&egalax_ts_pm_ops), .of_match_table = egalax_ts_dt_ids, }, .id_table = egalax_ts_id, -- cgit v1.2.3 From 717ba04a88a00699bf864acce2edbef9bd1e4443 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:17 +0000 Subject: input: ektf2127 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Jonathan Neuschäfer Cc: Hans de Goede Reviewed-by: Hans de Goede Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-45-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ektf2127.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c index 328841eaa1b7..e6f1e46d003d 100644 --- a/drivers/input/touchscreen/ektf2127.c +++ b/drivers/input/touchscreen/ektf2127.c @@ -177,7 +177,7 @@ static void ektf2127_stop(struct input_dev *dev) gpiod_set_value_cansleep(ts->power_gpios, 0); } -static int __maybe_unused ektf2127_suspend(struct device *dev) +static int ektf2127_suspend(struct device *dev) { struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev)); @@ -189,7 +189,7 @@ static int __maybe_unused ektf2127_suspend(struct device *dev) return 0; } -static int __maybe_unused ektf2127_resume(struct device *dev) +static int ektf2127_resume(struct device *dev) { struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev)); @@ -201,8 +201,8 @@ static int __maybe_unused ektf2127_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend, - ektf2127_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend, + ektf2127_resume); static int ektf2127_query_dimension(struct i2c_client *client, bool width) { @@ -348,7 +348,7 @@ MODULE_DEVICE_TABLE(i2c, ektf2127_i2c_id); static struct i2c_driver ektf2127_driver = { .driver = { .name = "elan_ektf2127", - .pm = &ektf2127_pm_ops, + .pm = pm_sleep_ptr(&ektf2127_pm_ops), .of_match_table = of_match_ptr(ektf2127_of_match), }, .probe_new = ektf2127_probe, -- cgit v1.2.3 From df0f673485d226d812b51470b5673582e756aaca Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:18 +0000 Subject: Input: elants_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Douglas Anderson Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-46-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/elants_i2c.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index 5452b50f8a77..8a16eb51481f 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -1572,7 +1572,7 @@ static int elants_i2c_probe(struct i2c_client *client) return 0; } -static int __maybe_unused elants_i2c_suspend(struct device *dev) +static int elants_i2c_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct elants_data *ts = i2c_get_clientdata(client); @@ -1611,7 +1611,7 @@ static int __maybe_unused elants_i2c_suspend(struct device *dev) return 0; } -static int __maybe_unused elants_i2c_resume(struct device *dev) +static int elants_i2c_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct elants_data *ts = i2c_get_clientdata(client); @@ -1644,8 +1644,8 @@ static int __maybe_unused elants_i2c_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(elants_i2c_pm_ops, - elants_i2c_suspend, elants_i2c_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(elants_i2c_pm_ops, + elants_i2c_suspend, elants_i2c_resume); static const struct i2c_device_id elants_i2c_id[] = { { DEVICE_NAME, EKTH3500 }, @@ -1677,7 +1677,7 @@ static struct i2c_driver elants_i2c_driver = { .id_table = elants_i2c_id, .driver = { .name = DEVICE_NAME, - .pm = &elants_i2c_pm_ops, + .pm = pm_sleep_ptr(&elants_i2c_pm_ops), .acpi_match_table = ACPI_PTR(elants_acpi_id), .of_match_table = of_match_ptr(elants_of_match), .probe_type = PROBE_PREFER_ASYNCHRONOUS, -- cgit v1.2.3 From 05ebb78bf8d695a42593f638df9b07a960f38cc6 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:19 +0000 Subject: Input: goodix - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Hans de Goede Cc: Bastien Nocera Reviewed-by: Hans de Goede Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-47-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/goodix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 7e3e86617548..277a46533564 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -1390,7 +1390,7 @@ static void goodix_ts_remove(struct i2c_client *client) wait_for_completion(&ts->firmware_loading_complete); } -static int __maybe_unused goodix_suspend(struct device *dev) +static int goodix_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct goodix_ts_data *ts = i2c_get_clientdata(client); @@ -1437,7 +1437,7 @@ static int __maybe_unused goodix_suspend(struct device *dev) return 0; } -static int __maybe_unused goodix_resume(struct device *dev) +static int goodix_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct goodix_ts_data *ts = i2c_get_clientdata(client); @@ -1486,7 +1486,7 @@ static int __maybe_unused goodix_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume); static const struct i2c_device_id goodix_ts_id[] = { { "GDIX1001:00", 0 }, @@ -1532,7 +1532,7 @@ static struct i2c_driver goodix_ts_driver = { .name = "Goodix-TS", .acpi_match_table = ACPI_PTR(goodix_acpi_match), .of_match_table = of_match_ptr(goodix_of_match), - .pm = &goodix_pm_ops, + .pm = pm_sleep_ptr(&goodix_pm_ops), }, }; module_i2c_driver(goodix_ts_driver); -- cgit v1.2.3 From 311fd6b03c607c3dfcc84739fddef0fa3de35cd3 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:20 +0000 Subject: Input: hideep - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Anthony Kim Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-48-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/hideep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c index ff4bb4c14898..bd454d93f1f7 100644 --- a/drivers/input/touchscreen/hideep.c +++ b/drivers/input/touchscreen/hideep.c @@ -959,7 +959,7 @@ static const struct attribute_group hideep_ts_attr_group = { .attrs = hideep_ts_sysfs_entries, }; -static int __maybe_unused hideep_suspend(struct device *dev) +static int hideep_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct hideep_ts *ts = i2c_get_clientdata(client); @@ -970,7 +970,7 @@ static int __maybe_unused hideep_suspend(struct device *dev) return 0; } -static int __maybe_unused hideep_resume(struct device *dev) +static int hideep_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct hideep_ts *ts = i2c_get_clientdata(client); @@ -987,7 +987,7 @@ static int __maybe_unused hideep_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume); static const struct regmap_config hideep_regmap_config = { .reg_bits = 16, @@ -1108,7 +1108,7 @@ static struct i2c_driver hideep_driver = { .name = HIDEEP_I2C_NAME, .of_match_table = of_match_ptr(hideep_match_table), .acpi_match_table = ACPI_PTR(hideep_acpi_id), - .pm = &hideep_pm_ops, + .pm = pm_sleep_ptr(&hideep_pm_ops), }, .id_table = hideep_i2c_id, .probe_new = hideep_probe, -- cgit v1.2.3 From 4024f8481ac294bba64071d44684d3400a395e4e Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:21 +0000 Subject: Input: ilitek_ts_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Joe Hung Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-49-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ilitek_ts_i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c index e6ade3775a8a..d69809338498 100644 --- a/drivers/input/touchscreen/ilitek_ts_i2c.c +++ b/drivers/input/touchscreen/ilitek_ts_i2c.c @@ -604,7 +604,7 @@ static int ilitek_ts_i2c_probe(struct i2c_client *client) return 0; } -static int __maybe_unused ilitek_suspend(struct device *dev) +static int ilitek_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct ilitek_ts_data *ts = i2c_get_clientdata(client); @@ -621,7 +621,7 @@ static int __maybe_unused ilitek_suspend(struct device *dev) return 0; } -static int __maybe_unused ilitek_resume(struct device *dev) +static int ilitek_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct ilitek_ts_data *ts = i2c_get_clientdata(client); @@ -640,7 +640,7 @@ static int __maybe_unused ilitek_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume); static const struct i2c_device_id ilitek_ts_i2c_id[] = { { ILITEK_TS_NAME, 0 }, @@ -675,7 +675,7 @@ MODULE_DEVICE_TABLE(of, ilitek_ts_i2c_match); static struct i2c_driver ilitek_ts_i2c_driver = { .driver = { .name = ILITEK_TS_NAME, - .pm = &ilitek_pm_ops, + .pm = pm_sleep_ptr(&ilitek_pm_ops), .of_match_table = of_match_ptr(ilitek_ts_i2c_match), .acpi_match_table = ACPI_PTR(ilitekts_acpi_id), }, -- cgit v1.2.3 From a9b113302ca684e4335f9c7ae5a3b78b08030760 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:22 +0000 Subject: Input: imagis - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Markuss Broks Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-50-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/imagis.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen/imagis.c index e2697e6c6d2a..de1b16e94bb8 100644 --- a/drivers/input/touchscreen/imagis.c +++ b/drivers/input/touchscreen/imagis.c @@ -309,7 +309,7 @@ static int imagis_probe(struct i2c_client *i2c) return 0; } -static int __maybe_unused imagis_suspend(struct device *dev) +static int imagis_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct imagis_ts *ts = i2c_get_clientdata(client); @@ -325,7 +325,7 @@ static int __maybe_unused imagis_suspend(struct device *dev) return retval; } -static int __maybe_unused imagis_resume(struct device *dev) +static int imagis_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct imagis_ts *ts = i2c_get_clientdata(client); @@ -341,7 +341,7 @@ static int __maybe_unused imagis_resume(struct device *dev) return retval; } -static SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume); #ifdef CONFIG_OF static const struct of_device_id imagis_of_match[] = { @@ -354,7 +354,7 @@ MODULE_DEVICE_TABLE(of, imagis_of_match); static struct i2c_driver imagis_ts_driver = { .driver = { .name = "imagis-touchscreen", - .pm = &imagis_pm_ops, + .pm = pm_sleep_ptr(&imagis_pm_ops), .of_match_table = of_match_ptr(imagis_of_match), }, .probe_new = imagis_probe, -- cgit v1.2.3 From a068aa5760acba85c203dcf2d3547a3076eb7041 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:23 +0000 Subject: Input: imx6ul_tsc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Haibo Chen Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-51-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/imx6ul_tsc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c index 2d4facf70cdb..6ac8fa84ed9f 100644 --- a/drivers/input/touchscreen/imx6ul_tsc.c +++ b/drivers/input/touchscreen/imx6ul_tsc.c @@ -512,7 +512,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) return 0; } -static int __maybe_unused imx6ul_tsc_suspend(struct device *dev) +static int imx6ul_tsc_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct imx6ul_tsc *tsc = platform_get_drvdata(pdev); @@ -528,7 +528,7 @@ static int __maybe_unused imx6ul_tsc_suspend(struct device *dev) return 0; } -static int __maybe_unused imx6ul_tsc_resume(struct device *dev) +static int imx6ul_tsc_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct imx6ul_tsc *tsc = platform_get_drvdata(pdev); @@ -545,8 +545,8 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev) return retval; } -static SIMPLE_DEV_PM_OPS(imx6ul_tsc_pm_ops, - imx6ul_tsc_suspend, imx6ul_tsc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(imx6ul_tsc_pm_ops, + imx6ul_tsc_suspend, imx6ul_tsc_resume); static const struct of_device_id imx6ul_tsc_match[] = { { .compatible = "fsl,imx6ul-tsc", }, @@ -558,7 +558,7 @@ static struct platform_driver imx6ul_tsc_driver = { .driver = { .name = "imx6ul-tsc", .of_match_table = imx6ul_tsc_match, - .pm = &imx6ul_tsc_pm_ops, + .pm = pm_sleep_ptr(&imx6ul_tsc_pm_ops), }, .probe = imx6ul_tsc_probe, }; -- cgit v1.2.3 From 5662a37d06bf1ef8bda7cf8be80876ea0d7f4739 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:24 +0000 Subject: Input: iqs5xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Jeff LaBundy Reviewed-by: Jeff LaBundy Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-52-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/iqs5xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c index dc3137a34f35..c73e9c5c0077 100644 --- a/drivers/input/touchscreen/iqs5xx.c +++ b/drivers/input/touchscreen/iqs5xx.c @@ -979,7 +979,7 @@ static const struct attribute_group iqs5xx_attr_group = { .attrs = iqs5xx_attrs, }; -static int __maybe_unused iqs5xx_suspend(struct device *dev) +static int iqs5xx_suspend(struct device *dev) { struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); struct input_dev *input = iqs5xx->input; @@ -998,7 +998,7 @@ static int __maybe_unused iqs5xx_suspend(struct device *dev) return error; } -static int __maybe_unused iqs5xx_resume(struct device *dev) +static int iqs5xx_resume(struct device *dev) { struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); struct input_dev *input = iqs5xx->input; @@ -1017,7 +1017,7 @@ static int __maybe_unused iqs5xx_resume(struct device *dev) return error; } -static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume); static int iqs5xx_probe(struct i2c_client *client) { @@ -1090,7 +1090,7 @@ static struct i2c_driver iqs5xx_i2c_driver = { .driver = { .name = "iqs5xx", .of_match_table = iqs5xx_of_match, - .pm = &iqs5xx_pm, + .pm = pm_sleep_ptr(&iqs5xx_pm), }, .id_table = iqs5xx_id, .probe_new = iqs5xx_probe, -- cgit v1.2.3 From 70f36d0cda2b68bab1f51b54991cf3182355bd4d Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:25 +0000 Subject: Input: mcs5000_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-53-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/mcs5000_ts.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c index ea9517cad695..704e36087ca2 100644 --- a/drivers/input/touchscreen/mcs5000_ts.c +++ b/drivers/input/touchscreen/mcs5000_ts.c @@ -241,7 +241,7 @@ static int mcs5000_ts_probe(struct i2c_client *client) return 0; } -static int __maybe_unused mcs5000_ts_suspend(struct device *dev) +static int mcs5000_ts_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -251,7 +251,7 @@ static int __maybe_unused mcs5000_ts_suspend(struct device *dev) return 0; } -static int __maybe_unused mcs5000_ts_resume(struct device *dev) +static int mcs5000_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct mcs5000_ts_data *data = i2c_get_clientdata(client); @@ -262,7 +262,8 @@ static int __maybe_unused mcs5000_ts_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, + mcs5000_ts_suspend, mcs5000_ts_resume); static const struct i2c_device_id mcs5000_ts_id[] = { { "mcs5000_ts", 0 }, @@ -274,7 +275,7 @@ static struct i2c_driver mcs5000_ts_driver = { .probe_new = mcs5000_ts_probe, .driver = { .name = "mcs5000_ts", - .pm = &mcs5000_ts_pm, + .pm = pm_sleep_ptr(&mcs5000_ts_pm), }, .id_table = mcs5000_ts_id, }; -- cgit v1.2.3 From e6a80bce242585cbf11fe18f2dbd4b1876273ba8 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:26 +0000 Subject: Input: melfas_mip4 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Sangwon Jee Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-54-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/melfas_mip4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c index 4ee8ed4c930c..acdfbdea2b6e 100644 --- a/drivers/input/touchscreen/melfas_mip4.c +++ b/drivers/input/touchscreen/melfas_mip4.c @@ -1528,7 +1528,7 @@ static int mip4_probe(struct i2c_client *client) return 0; } -static int __maybe_unused mip4_suspend(struct device *dev) +static int mip4_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct mip4_ts *ts = i2c_get_clientdata(client); @@ -1546,7 +1546,7 @@ static int __maybe_unused mip4_suspend(struct device *dev) return 0; } -static int __maybe_unused mip4_resume(struct device *dev) +static int mip4_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct mip4_ts *ts = i2c_get_clientdata(client); @@ -1564,7 +1564,7 @@ static int __maybe_unused mip4_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(mip4_pm_ops, mip4_suspend, mip4_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mip4_pm_ops, mip4_suspend, mip4_resume); #ifdef CONFIG_OF static const struct of_device_id mip4_of_match[] = { @@ -1595,7 +1595,7 @@ static struct i2c_driver mip4_driver = { .name = MIP4_DEVICE_NAME, .of_match_table = of_match_ptr(mip4_of_match), .acpi_match_table = ACPI_PTR(mip4_acpi_match), - .pm = &mip4_pm_ops, + .pm = pm_sleep_ptr(&mip4_pm_ops), }, }; module_i2c_driver(mip4_driver); -- cgit v1.2.3 From 3a841b3ee8a77dc8a0a25d3bd43b493d2f895b15 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:27 +0000 Subject: input: migor_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-55-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/migor_ts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c index ff0f605f3a3a..69fcc88d4f80 100644 --- a/drivers/input/touchscreen/migor_ts.c +++ b/drivers/input/touchscreen/migor_ts.c @@ -186,7 +186,7 @@ static void migor_ts_remove(struct i2c_client *client) dev_set_drvdata(&client->dev, NULL); } -static int __maybe_unused migor_ts_suspend(struct device *dev) +static int migor_ts_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct migor_ts_priv *priv = i2c_get_clientdata(client); @@ -197,7 +197,7 @@ static int __maybe_unused migor_ts_suspend(struct device *dev) return 0; } -static int __maybe_unused migor_ts_resume(struct device *dev) +static int migor_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct migor_ts_priv *priv = i2c_get_clientdata(client); @@ -208,7 +208,7 @@ static int __maybe_unused migor_ts_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume); static const struct i2c_device_id migor_ts_id[] = { { "migor_ts", 0 }, @@ -219,7 +219,7 @@ MODULE_DEVICE_TABLE(i2c, migor_ts_id); static struct i2c_driver migor_ts_driver = { .driver = { .name = "migor_ts", - .pm = &migor_ts_pm, + .pm = pm_sleep_ptr(&migor_ts_pm), }, .probe_new = migor_ts_probe, .remove = migor_ts_remove, -- cgit v1.2.3 From 9b61c454131b3529d9f843a7bcc34b0f4cf6ca40 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:28 +0000 Subject: Input: mms114 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-56-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/mms114.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c index 758b669391a7..4dbca1aad89d 100644 --- a/drivers/input/touchscreen/mms114.c +++ b/drivers/input/touchscreen/mms114.c @@ -557,7 +557,7 @@ static int mms114_probe(struct i2c_client *client) return 0; } -static int __maybe_unused mms114_suspend(struct device *dev) +static int mms114_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct mms114_data *data = i2c_get_clientdata(client); @@ -581,7 +581,7 @@ static int __maybe_unused mms114_suspend(struct device *dev) return 0; } -static int __maybe_unused mms114_resume(struct device *dev) +static int mms114_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct mms114_data *data = i2c_get_clientdata(client); @@ -601,7 +601,7 @@ static int __maybe_unused mms114_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(mms114_pm_ops, mms114_suspend, mms114_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mms114_pm_ops, mms114_suspend, mms114_resume); static const struct i2c_device_id mms114_id[] = { { "mms114", 0 }, @@ -635,7 +635,7 @@ MODULE_DEVICE_TABLE(of, mms114_dt_match); static struct i2c_driver mms114_driver = { .driver = { .name = "mms114", - .pm = &mms114_pm_ops, + .pm = pm_sleep_ptr(&mms114_pm_ops), .of_match_table = of_match_ptr(mms114_dt_match), }, .probe_new = mms114_probe, -- cgit v1.2.3 From a43be2dde97e047ddf0ec365bef212c7d4f1c86e Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:29 +0000 Subject: Input: msg2638 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Vincent Knecht Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-57-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/msg2638.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/msg2638.c b/drivers/input/touchscreen/msg2638.c index 4c0816b09d33..b23db689d995 100644 --- a/drivers/input/touchscreen/msg2638.c +++ b/drivers/input/touchscreen/msg2638.c @@ -441,7 +441,7 @@ static int msg2638_ts_probe(struct i2c_client *client) return 0; } -static int __maybe_unused msg2638_suspend(struct device *dev) +static int msg2638_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client); @@ -456,7 +456,7 @@ static int __maybe_unused msg2638_suspend(struct device *dev) return 0; } -static int __maybe_unused msg2638_resume(struct device *dev) +static int msg2638_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client); @@ -472,7 +472,7 @@ static int __maybe_unused msg2638_resume(struct device *dev) return ret; } -static SIMPLE_DEV_PM_OPS(msg2638_pm_ops, msg2638_suspend, msg2638_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(msg2638_pm_ops, msg2638_suspend, msg2638_resume); static const struct msg_chip_data msg2138_data = { .irq_handler = msg2138_ts_irq_handler, @@ -495,7 +495,7 @@ static struct i2c_driver msg2638_ts_driver = { .probe_new = msg2638_ts_probe, .driver = { .name = "MStar-TS", - .pm = &msg2638_pm_ops, + .pm = pm_sleep_ptr(&msg2638_pm_ops), .of_match_table = msg2638_of_match, }, }; -- cgit v1.2.3 From add8bbd27acd4b246446fbb31ed7284c48d36200 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:30 +0000 Subject: Input: pixcir_i2c_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Fabio Estevam Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-58-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/pixcir_i2c_ts.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index 7959947a3458..f09f4831bad4 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c @@ -405,7 +405,7 @@ static void pixcir_input_close(struct input_dev *dev) pixcir_stop(ts); } -static int __maybe_unused pixcir_i2c_ts_suspend(struct device *dev) +static int pixcir_i2c_ts_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); @@ -432,7 +432,7 @@ unlock: return ret; } -static int __maybe_unused pixcir_i2c_ts_resume(struct device *dev) +static int pixcir_i2c_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); @@ -459,8 +459,8 @@ unlock: return ret; } -static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops, - pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops, + pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume); static int pixcir_i2c_ts_probe(struct i2c_client *client) { @@ -614,7 +614,7 @@ MODULE_DEVICE_TABLE(of, pixcir_of_match); static struct i2c_driver pixcir_i2c_ts_driver = { .driver = { .name = "pixcir_ts", - .pm = &pixcir_dev_pm_ops, + .pm = pm_sleep_ptr(&pixcir_dev_pm_ops), .of_match_table = of_match_ptr(pixcir_of_match), }, .probe_new = pixcir_i2c_ts_probe, -- cgit v1.2.3 From 9fca27cffb9ffe988e76720213b49a9018b95020 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:31 +0000 Subject: Input: raydium_i2c_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-59-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/raydium_i2c_ts.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c index b174642d523b..1e5e126c117b 100644 --- a/drivers/input/touchscreen/raydium_i2c_ts.c +++ b/drivers/input/touchscreen/raydium_i2c_ts.c @@ -1195,7 +1195,7 @@ static int raydium_i2c_probe(struct i2c_client *client) return 0; } -static void __maybe_unused raydium_enter_sleep(struct i2c_client *client) +static void raydium_enter_sleep(struct i2c_client *client) { static const u8 sleep_cmd[] = { 0x5A, 0xff, 0x00, 0x0f }; int error; @@ -1207,7 +1207,7 @@ static void __maybe_unused raydium_enter_sleep(struct i2c_client *client) "sleep command failed: %d\n", error); } -static int __maybe_unused raydium_i2c_suspend(struct device *dev) +static int raydium_i2c_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct raydium_data *ts = i2c_get_clientdata(client); @@ -1227,7 +1227,7 @@ static int __maybe_unused raydium_i2c_suspend(struct device *dev) return 0; } -static int __maybe_unused raydium_i2c_resume(struct device *dev) +static int raydium_i2c_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct raydium_data *ts = i2c_get_clientdata(client); @@ -1244,8 +1244,8 @@ static int __maybe_unused raydium_i2c_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(raydium_i2c_pm_ops, - raydium_i2c_suspend, raydium_i2c_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(raydium_i2c_pm_ops, + raydium_i2c_suspend, raydium_i2c_resume); static const struct i2c_device_id raydium_i2c_id[] = { { "raydium_i2c", 0 }, @@ -1275,7 +1275,7 @@ static struct i2c_driver raydium_i2c_driver = { .id_table = raydium_i2c_id, .driver = { .name = "raydium_ts", - .pm = &raydium_i2c_pm_ops, + .pm = pm_sleep_ptr(&raydium_i2c_pm_ops), .acpi_match_table = ACPI_PTR(raydium_acpi_id), .of_match_table = of_match_ptr(raydium_of_match), }, -- cgit v1.2.3 From 5a88638218e4fbed794405929500590e52b9e5c5 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:32 +0000 Subject: Input: silead - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Hans de Goede Reviewed-by: Hans de Goede Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-60-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/silead.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c index 8a7351c4414c..a37fac089010 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c @@ -736,7 +736,7 @@ static int silead_ts_probe(struct i2c_client *client) return 0; } -static int __maybe_unused silead_ts_suspend(struct device *dev) +static int silead_ts_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -745,7 +745,7 @@ static int __maybe_unused silead_ts_suspend(struct device *dev) return 0; } -static int __maybe_unused silead_ts_resume(struct device *dev) +static int silead_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); bool second_try = false; @@ -784,7 +784,7 @@ static int __maybe_unused silead_ts_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(silead_ts_pm, silead_ts_suspend, silead_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(silead_ts_pm, silead_ts_suspend, silead_ts_resume); static const struct i2c_device_id silead_ts_id[] = { { "gsl1680", 0 }, @@ -832,7 +832,7 @@ static struct i2c_driver silead_ts_driver = { .name = SILEAD_TS_NAME, .acpi_match_table = ACPI_PTR(silead_ts_acpi_match), .of_match_table = of_match_ptr(silead_ts_of_match), - .pm = &silead_ts_pm, + .pm = pm_sleep_ptr(&silead_ts_pm), }, }; module_i2c_driver(silead_ts_driver); -- cgit v1.2.3 From 7c8d436dc9a0e216535931c23e0df96acf27b52b Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:33 +0000 Subject: Input: st1232 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: John Keeping Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-61-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/st1232.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index bd68633dc6c0..f49566dc96f8 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -340,7 +340,7 @@ static int st1232_ts_probe(struct i2c_client *client) return 0; } -static int __maybe_unused st1232_ts_suspend(struct device *dev) +static int st1232_ts_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct st1232_ts_data *ts = i2c_get_clientdata(client); @@ -353,7 +353,7 @@ static int __maybe_unused st1232_ts_suspend(struct device *dev) return 0; } -static int __maybe_unused st1232_ts_resume(struct device *dev) +static int st1232_ts_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct st1232_ts_data *ts = i2c_get_clientdata(client); @@ -366,8 +366,8 @@ static int __maybe_unused st1232_ts_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops, - st1232_ts_suspend, st1232_ts_resume); +static DEFINE_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, (unsigned long)&st1232_chip_info }, @@ -390,7 +390,7 @@ static struct i2c_driver st1232_ts_driver = { .name = ST1232_TS_NAME, .of_match_table = st1232_ts_dt_ids, .probe_type = PROBE_PREFER_ASYNCHRONOUS, - .pm = &st1232_ts_pm_ops, + .pm = pm_sleep_ptr(&st1232_ts_pm_ops), }, }; -- cgit v1.2.3 From ea476f51bebb1f1d2ff03bdcd1a54280a58b3366 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:34 +0000 Subject: Input: surface3_spi - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Stephen Just Cc: Benjamin Tissoires Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-62-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/surface3_spi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c index 1da23e5585a0..31d140248f2e 100644 --- a/drivers/input/touchscreen/surface3_spi.c +++ b/drivers/input/touchscreen/surface3_spi.c @@ -369,7 +369,7 @@ static int surface3_spi_probe(struct spi_device *spi) return 0; } -static int __maybe_unused surface3_spi_suspend(struct device *dev) +static int surface3_spi_suspend(struct device *dev) { struct spi_device *spi = to_spi_device(dev); struct surface3_ts_data *data = spi_get_drvdata(spi); @@ -381,7 +381,7 @@ static int __maybe_unused surface3_spi_suspend(struct device *dev) return 0; } -static int __maybe_unused surface3_spi_resume(struct device *dev) +static int surface3_spi_resume(struct device *dev) { struct spi_device *spi = to_spi_device(dev); struct surface3_ts_data *data = spi_get_drvdata(spi); @@ -393,9 +393,9 @@ static int __maybe_unused surface3_spi_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops, - surface3_spi_suspend, - surface3_spi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops, + surface3_spi_suspend, + surface3_spi_resume); #ifdef CONFIG_ACPI static const struct acpi_device_id surface3_spi_acpi_match[] = { @@ -409,7 +409,7 @@ static struct spi_driver surface3_spi_driver = { .driver = { .name = "Surface3-spi", .acpi_match_table = ACPI_PTR(surface3_spi_acpi_match), - .pm = &surface3_spi_pm_ops, + .pm = pm_sleep_ptr(&surface3_spi_pm_ops), }, .probe = surface3_spi_probe, }; -- cgit v1.2.3 From f84016434752607190e3208ccbc01f738296456c Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:35 +0000 Subject: Input: ti_am335x_tsc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Dario Binacchi Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-63-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ti_am335x_tsc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index f2fb6a9a1a57..decf2d24a115 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -512,7 +512,7 @@ static int titsc_remove(struct platform_device *pdev) return 0; } -static int __maybe_unused titsc_suspend(struct device *dev) +static int titsc_suspend(struct device *dev) { struct titsc *ts_dev = dev_get_drvdata(dev); unsigned int idle; @@ -527,7 +527,7 @@ static int __maybe_unused titsc_suspend(struct device *dev) return 0; } -static int __maybe_unused titsc_resume(struct device *dev) +static int titsc_resume(struct device *dev) { struct titsc *ts_dev = dev_get_drvdata(dev); @@ -543,7 +543,7 @@ static int __maybe_unused titsc_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume); static const struct of_device_id ti_tsc_dt_ids[] = { { .compatible = "ti,am3359-tsc", }, @@ -556,7 +556,7 @@ static struct platform_driver ti_tsc_driver = { .remove = titsc_remove, .driver = { .name = "TI-am335x-tsc", - .pm = &titsc_pm_ops, + .pm = pm_sleep_ptr(&titsc_pm_ops), .of_match_table = ti_tsc_dt_ids, }, }; -- cgit v1.2.3 From 2cfa7c9c55d8c8cc076c457b0ca169f90d140d95 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:36 +0000 Subject: Input: ucb1400_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-64-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ucb1400_ts.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index dfd3b35590c3..1b3d1df231bb 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c @@ -401,7 +401,7 @@ static int ucb1400_ts_remove(struct platform_device *pdev) return 0; } -static int __maybe_unused ucb1400_ts_suspend(struct device *dev) +static int ucb1400_ts_suspend(struct device *dev) { struct ucb1400_ts *ucb = dev_get_platdata(dev); struct input_dev *idev = ucb->ts_idev; @@ -415,7 +415,7 @@ static int __maybe_unused ucb1400_ts_suspend(struct device *dev) return 0; } -static int __maybe_unused ucb1400_ts_resume(struct device *dev) +static int ucb1400_ts_resume(struct device *dev) { struct ucb1400_ts *ucb = dev_get_platdata(dev); struct input_dev *idev = ucb->ts_idev; @@ -429,15 +429,15 @@ static int __maybe_unused ucb1400_ts_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ucb1400_ts_pm_ops, - ucb1400_ts_suspend, ucb1400_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ucb1400_ts_pm_ops, + ucb1400_ts_suspend, ucb1400_ts_resume); static struct platform_driver ucb1400_ts_driver = { .probe = ucb1400_ts_probe, .remove = ucb1400_ts_remove, .driver = { .name = "ucb1400_ts", - .pm = &ucb1400_ts_pm_ops, + .pm = pm_sleep_ptr(&ucb1400_ts_pm_ops), }, }; module_platform_driver(ucb1400_ts_driver); -- cgit v1.2.3 From 5ca74320a748545677071bcb89e92cded7f317ad Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:37 +0000 Subject: Input: wacom_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Alistair Francis Reviewed-by: Alistair Francis Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-65-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/wacom_i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index c9188ee00c62..a145b9105255 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -232,7 +232,7 @@ static int wacom_i2c_probe(struct i2c_client *client) return 0; } -static int __maybe_unused wacom_i2c_suspend(struct device *dev) +static int wacom_i2c_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -241,7 +241,7 @@ static int __maybe_unused wacom_i2c_suspend(struct device *dev) return 0; } -static int __maybe_unused wacom_i2c_resume(struct device *dev) +static int wacom_i2c_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -250,7 +250,7 @@ static int __maybe_unused wacom_i2c_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(wacom_i2c_pm, wacom_i2c_suspend, wacom_i2c_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(wacom_i2c_pm, wacom_i2c_suspend, wacom_i2c_resume); static const struct i2c_device_id wacom_i2c_id[] = { { "WAC_I2C_EMR", 0 }, @@ -261,7 +261,7 @@ MODULE_DEVICE_TABLE(i2c, wacom_i2c_id); static struct i2c_driver wacom_i2c_driver = { .driver = { .name = "wacom_i2c", - .pm = &wacom_i2c_pm, + .pm = pm_sleep_ptr(&wacom_i2c_pm), }, .probe_new = wacom_i2c_probe, -- cgit v1.2.3 From fa8d5a6e7145262004fc1f7746c5a4edc6c11334 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:38 +0000 Subject: Input: wdt87xx_i2c - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-66-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/wdt87xx_i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c index 3f87db5cdca4..771962af3d0a 100644 --- a/drivers/input/touchscreen/wdt87xx_i2c.c +++ b/drivers/input/touchscreen/wdt87xx_i2c.c @@ -1113,7 +1113,7 @@ static int wdt87xx_ts_probe(struct i2c_client *client) return 0; } -static int __maybe_unused wdt87xx_suspend(struct device *dev) +static int wdt87xx_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); int error; @@ -1132,7 +1132,7 @@ static int __maybe_unused wdt87xx_suspend(struct device *dev) return 0; } -static int __maybe_unused wdt87xx_resume(struct device *dev) +static int wdt87xx_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); int error; @@ -1154,7 +1154,7 @@ static int __maybe_unused wdt87xx_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(wdt87xx_pm_ops, wdt87xx_suspend, wdt87xx_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(wdt87xx_pm_ops, wdt87xx_suspend, wdt87xx_resume); static const struct i2c_device_id wdt87xx_dev_id[] = { { WDT87XX_NAME, 0 }, @@ -1173,7 +1173,7 @@ static struct i2c_driver wdt87xx_driver = { .id_table = wdt87xx_dev_id, .driver = { .name = WDT87XX_NAME, - .pm = &wdt87xx_pm_ops, + .pm = pm_sleep_ptr(&wdt87xx_pm_ops), .acpi_match_table = ACPI_PTR(wdt87xx_acpi_id), }, }; -- cgit v1.2.3 From fea26099aee23c3dace5fe1a47ec3de919782485 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:39 +0000 Subject: Input: wm97xx - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-67-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/wm97xx-core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index f51ab5614532..ac3b3dd59488 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c @@ -763,7 +763,7 @@ static int wm97xx_mfd_remove(struct platform_device *pdev) return 0; } -static int __maybe_unused wm97xx_suspend(struct device *dev) +static int wm97xx_suspend(struct device *dev) { struct wm97xx *wm = dev_get_drvdata(dev); u16 reg; @@ -797,7 +797,7 @@ static int __maybe_unused wm97xx_suspend(struct device *dev) return 0; } -static int __maybe_unused wm97xx_resume(struct device *dev) +static int wm97xx_resume(struct device *dev) { struct wm97xx *wm = dev_get_drvdata(dev); @@ -833,7 +833,7 @@ static int __maybe_unused wm97xx_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume); /* * Machine specific operations @@ -869,13 +869,13 @@ static struct device_driver wm97xx_driver = { .owner = THIS_MODULE, .probe = wm97xx_probe, .remove = wm97xx_remove, - .pm = &wm97xx_pm_ops, + .pm = pm_sleep_ptr(&wm97xx_pm_ops), }; static struct platform_driver wm97xx_mfd_driver = { .driver = { .name = "wm97xx-ts", - .pm = &wm97xx_pm_ops, + .pm = pm_sleep_ptr(&wm97xx_pm_ops), }, .probe = wm97xx_mfd_probe, .remove = wm97xx_mfd_remove, -- cgit v1.2.3 From dc69e98a55207267be3b5cb8ec12db3aa41aef63 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:40 +0000 Subject: Input: zforce_ts - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-68-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/zforce_ts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c index 24e78ca83fa3..76b194285e1c 100644 --- a/drivers/input/touchscreen/zforce_ts.c +++ b/drivers/input/touchscreen/zforce_ts.c @@ -608,7 +608,7 @@ static void zforce_input_close(struct input_dev *dev) return; } -static int __maybe_unused zforce_suspend(struct device *dev) +static int zforce_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct zforce_ts *ts = i2c_get_clientdata(client); @@ -653,7 +653,7 @@ unlock: return ret; } -static int __maybe_unused zforce_resume(struct device *dev) +static int zforce_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct zforce_ts *ts = i2c_get_clientdata(client); @@ -691,7 +691,7 @@ unlock: return ret; } -static SIMPLE_DEV_PM_OPS(zforce_pm_ops, zforce_suspend, zforce_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(zforce_pm_ops, zforce_suspend, zforce_resume); static void zforce_reset(void *data) { @@ -941,7 +941,7 @@ MODULE_DEVICE_TABLE(of, zforce_dt_idtable); static struct i2c_driver zforce_driver = { .driver = { .name = "zforce-ts", - .pm = &zforce_pm_ops, + .pm = pm_sleep_ptr(&zforce_pm_ops), .of_match_table = of_match_ptr(zforce_dt_idtable), }, .probe_new = zforce_probe, -- cgit v1.2.3 From 61df952bfd1ac1a67f030a472faa1eb78fa428fc Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:41 +0000 Subject: Input: zinitix - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-69-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/zinitix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/zinitix.c b/drivers/input/touchscreen/zinitix.c index 52f9e9eaab14..cdf9bcd744db 100644 --- a/drivers/input/touchscreen/zinitix.c +++ b/drivers/input/touchscreen/zinitix.c @@ -562,7 +562,7 @@ static int zinitix_ts_probe(struct i2c_client *client) return 0; } -static int __maybe_unused zinitix_suspend(struct device *dev) +static int zinitix_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct bt541_ts_data *bt541 = i2c_get_clientdata(client); @@ -577,7 +577,7 @@ static int __maybe_unused zinitix_suspend(struct device *dev) return 0; } -static int __maybe_unused zinitix_resume(struct device *dev) +static int zinitix_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct bt541_ts_data *bt541 = i2c_get_clientdata(client); @@ -593,7 +593,7 @@ static int __maybe_unused zinitix_resume(struct device *dev) return ret; } -static SIMPLE_DEV_PM_OPS(zinitix_pm_ops, zinitix_suspend, zinitix_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(zinitix_pm_ops, zinitix_suspend, zinitix_resume); #ifdef CONFIG_OF static const struct of_device_id zinitix_of_match[] = { @@ -620,7 +620,7 @@ static struct i2c_driver zinitix_ts_driver = { .probe_new = zinitix_ts_probe, .driver = { .name = "Zinitix-TS", - .pm = &zinitix_pm_ops, + .pm = pm_sleep_ptr(&zinitix_pm_ops), .of_match_table = of_match_ptr(zinitix_of_match), }, }; -- cgit v1.2.3 From 144ff5e03d745a299a9aabe2a597da843cf1c430 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Mon, 2 Jan 2023 18:18:42 +0000 Subject: Input: ipaq-micro-ts - use DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() This driver never used the older SIMPLE_DEV_PM_OPS() but instead just set two of the callbacks directly. Skip that deprecated macro and go straight to the new form that avoids the need for guarding or marking callbacks __maybe_unused. -- It is possible there is some subtle reason why only two of the callbacks normally set by SIMPLE_DEV_PM_OPS() are set. As such, this one needs some closer reading than many of the others. Signed-off-by: Jonathan Cameron Cc: Linus Walleij Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230102181842.718010-70-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ipaq-micro-ts.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ipaq-micro-ts.c b/drivers/input/touchscreen/ipaq-micro-ts.c index 0eb5689fe65f..d8e25b502968 100644 --- a/drivers/input/touchscreen/ipaq-micro-ts.c +++ b/drivers/input/touchscreen/ipaq-micro-ts.c @@ -119,7 +119,7 @@ static int micro_ts_probe(struct platform_device *pdev) return 0; } -static int __maybe_unused micro_ts_suspend(struct device *dev) +static int micro_ts_suspend(struct device *dev) { struct touchscreen_data *ts = dev_get_drvdata(dev); @@ -128,7 +128,7 @@ static int __maybe_unused micro_ts_suspend(struct device *dev) return 0; } -static int __maybe_unused micro_ts_resume(struct device *dev) +static int micro_ts_resume(struct device *dev) { struct touchscreen_data *ts = dev_get_drvdata(dev); struct input_dev *input = ts->input; @@ -143,14 +143,13 @@ static int __maybe_unused micro_ts_resume(struct device *dev) return 0; } -static const struct dev_pm_ops micro_ts_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(micro_ts_suspend, micro_ts_resume) -}; +static DEFINE_SIMPLE_DEV_PM(micro_ts_dev_pm_ops, + micro_ts_suspend, micro_ts_resume); static struct platform_driver micro_ts_device_driver = { .driver = { .name = "ipaq-micro-ts", - .pm = µ_ts_dev_pm_ops, + .pm = pm_sleep_ptr(µ_ts_dev_pm_ops), }, .probe = micro_ts_probe, }; -- cgit v1.2.3 From e2eaf9e0e10c8ce2b2740a89d1fab0649345e353 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sat, 14 Jan 2023 17:16:08 +0000 Subject: Input: s6sy761 - switch to SYSTEM_SLEEP_/RUNTIME_PM_OPS() and pm_ptr() SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() are deprecated as they require explicit protection against unused function warnings. The new combination of pm_ptr() and SYSTEM_SLEEP_PM_OPS()/ RUNTIME_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Caleb Connolly Cc: Andi Shyti Tested-by: Caleb Connolly # oneplus-guacamole Link: https://lore.kernel.org/r/20230114171620.42891-5-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/s6sy761.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c index cc417c03aaca..371cf4848ad5 100644 --- a/drivers/input/touchscreen/s6sy761.c +++ b/drivers/input/touchscreen/s6sy761.c @@ -479,7 +479,7 @@ static void s6sy761_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); } -static int __maybe_unused s6sy761_runtime_suspend(struct device *dev) +static int s6sy761_runtime_suspend(struct device *dev) { struct s6sy761_data *sdata = dev_get_drvdata(dev); @@ -487,7 +487,7 @@ static int __maybe_unused s6sy761_runtime_suspend(struct device *dev) S6SY761_APPLICATION_MODE, S6SY761_APP_SLEEP); } -static int __maybe_unused s6sy761_runtime_resume(struct device *dev) +static int s6sy761_runtime_resume(struct device *dev) { struct s6sy761_data *sdata = dev_get_drvdata(dev); @@ -495,7 +495,7 @@ static int __maybe_unused s6sy761_runtime_resume(struct device *dev) S6SY761_APPLICATION_MODE, S6SY761_APP_NORMAL); } -static int __maybe_unused s6sy761_suspend(struct device *dev) +static int s6sy761_suspend(struct device *dev) { struct s6sy761_data *sdata = dev_get_drvdata(dev); @@ -504,7 +504,7 @@ static int __maybe_unused s6sy761_suspend(struct device *dev) return 0; } -static int __maybe_unused s6sy761_resume(struct device *dev) +static int s6sy761_resume(struct device *dev) { struct s6sy761_data *sdata = dev_get_drvdata(dev); @@ -514,9 +514,8 @@ static int __maybe_unused s6sy761_resume(struct device *dev) } static const struct dev_pm_ops s6sy761_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(s6sy761_suspend, s6sy761_resume) - SET_RUNTIME_PM_OPS(s6sy761_runtime_suspend, - s6sy761_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(s6sy761_suspend, s6sy761_resume) + RUNTIME_PM_OPS(s6sy761_runtime_suspend, s6sy761_runtime_resume, NULL) }; #ifdef CONFIG_OF @@ -537,7 +536,7 @@ static struct i2c_driver s6sy761_driver = { .driver = { .name = S6SY761_DEV_NAME, .of_match_table = of_match_ptr(s6sy761_of_match), - .pm = &s6sy761_pm_ops, + .pm = pm_ptr(&s6sy761_pm_ops), }, .probe_new = s6sy761_probe, .remove = s6sy761_remove, -- cgit v1.2.3 From 90208b31f9380c376269bf7f24f4ab1f0e144617 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sat, 14 Jan 2023 17:16:10 +0000 Subject: Input: stmfts - switch to SYSTEM_SLEEP_/RUNTIME_PM_OPS() and pm_ptr() SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() are deprecated as they require explicit protection against unused function warnings. The new combination of pm_ptr() and SYSTEM_SLEEP_PM_OPS()/ RUNTIME_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron Cc: Andi Shyti Link: https://lore.kernel.org/r/20230114171620.42891-7-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/stmfts.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c index d092e89d40e8..fdbf5e68943c 100644 --- a/drivers/input/touchscreen/stmfts.c +++ b/drivers/input/touchscreen/stmfts.c @@ -742,7 +742,7 @@ static void stmfts_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); } -static int __maybe_unused stmfts_runtime_suspend(struct device *dev) +static int stmfts_runtime_suspend(struct device *dev) { struct stmfts_data *sdata = dev_get_drvdata(dev); int ret; @@ -754,7 +754,7 @@ static int __maybe_unused stmfts_runtime_suspend(struct device *dev) return ret; } -static int __maybe_unused stmfts_runtime_resume(struct device *dev) +static int stmfts_runtime_resume(struct device *dev) { struct stmfts_data *sdata = dev_get_drvdata(dev); int ret; @@ -766,7 +766,7 @@ static int __maybe_unused stmfts_runtime_resume(struct device *dev) return ret; } -static int __maybe_unused stmfts_suspend(struct device *dev) +static int stmfts_suspend(struct device *dev) { struct stmfts_data *sdata = dev_get_drvdata(dev); @@ -775,7 +775,7 @@ static int __maybe_unused stmfts_suspend(struct device *dev) return 0; } -static int __maybe_unused stmfts_resume(struct device *dev) +static int stmfts_resume(struct device *dev) { struct stmfts_data *sdata = dev_get_drvdata(dev); @@ -783,8 +783,8 @@ static int __maybe_unused stmfts_resume(struct device *dev) } static const struct dev_pm_ops stmfts_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(stmfts_suspend, stmfts_resume) - SET_RUNTIME_PM_OPS(stmfts_runtime_suspend, stmfts_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(stmfts_suspend, stmfts_resume) + RUNTIME_PM_OPS(stmfts_runtime_suspend, stmfts_runtime_resume, NULL) }; #ifdef CONFIG_OF @@ -805,7 +805,7 @@ static struct i2c_driver stmfts_driver = { .driver = { .name = STMFTS_DEV_NAME, .of_match_table = of_match_ptr(stmfts_of_match), - .pm = &stmfts_pm_ops, + .pm = pm_ptr(&stmfts_pm_ops), .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe_new = stmfts_probe, -- cgit v1.2.3 From 6470215b883eba58909871ec2268f734f1b3d646 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sat, 14 Jan 2023 17:16:13 +0000 Subject: Input: tsc200x - use EXPORT_GPL_SIMPLE_DEV_PM_OPS() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and EXPORT_GPL_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. This function also removes the need for separate EXPORT_SYMBOL_GPL() Signed-off-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230114171620.42891-10-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/tsc2004.c | 2 +- drivers/input/touchscreen/tsc2005.c | 2 +- drivers/input/touchscreen/tsc200x-core.c | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/tsc2004.c b/drivers/input/touchscreen/tsc2004.c index 575768b587bb..45f39eb20638 100644 --- a/drivers/input/touchscreen/tsc2004.c +++ b/drivers/input/touchscreen/tsc2004.c @@ -65,7 +65,7 @@ static struct i2c_driver tsc2004_driver = { .driver = { .name = "tsc2004", .of_match_table = of_match_ptr(tsc2004_of_match), - .pm = &tsc200x_pm_ops, + .pm = pm_sleep_ptr(&tsc200x_pm_ops), }, .id_table = tsc2004_idtable, .probe_new = tsc2004_probe, diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index 555dfe98b3c4..b6dfbcfc8c19 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c @@ -81,7 +81,7 @@ static struct spi_driver tsc2005_driver = { .driver = { .name = "tsc2005", .of_match_table = of_match_ptr(tsc2005_of_match), - .pm = &tsc200x_pm_ops, + .pm = pm_sleep_ptr(&tsc200x_pm_ops), }, .probe = tsc2005_probe, .remove = tsc2005_remove, diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c index 72c7258b93a5..b799f26fcf8f 100644 --- a/drivers/input/touchscreen/tsc200x-core.c +++ b/drivers/input/touchscreen/tsc200x-core.c @@ -588,7 +588,7 @@ void tsc200x_remove(struct device *dev) } EXPORT_SYMBOL_GPL(tsc200x_remove); -static int __maybe_unused tsc200x_suspend(struct device *dev) +static int tsc200x_suspend(struct device *dev) { struct tsc200x *ts = dev_get_drvdata(dev); @@ -604,7 +604,7 @@ static int __maybe_unused tsc200x_suspend(struct device *dev) return 0; } -static int __maybe_unused tsc200x_resume(struct device *dev) +static int tsc200x_resume(struct device *dev) { struct tsc200x *ts = dev_get_drvdata(dev); @@ -620,8 +620,7 @@ static int __maybe_unused tsc200x_resume(struct device *dev) return 0; } -SIMPLE_DEV_PM_OPS(tsc200x_pm_ops, tsc200x_suspend, tsc200x_resume); -EXPORT_SYMBOL_GPL(tsc200x_pm_ops); +EXPORT_GPL_SIMPLE_DEV_PM_OPS(tsc200x_pm_ops, tsc200x_suspend, tsc200x_resume); MODULE_AUTHOR("Lauri Leukkunen "); MODULE_DESCRIPTION("TSC200x Touchscreen Driver Core"); -- cgit v1.2.3 From ebbdbef28facff7ceadc091aa5279b3751da1d4a Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sat, 14 Jan 2023 17:16:14 +0000 Subject: Input: cyttsp4 - use EXPORT_GPL_RUNTIME_DEV_PM_OPS() SET_SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() are deprecated as they requires explicit protection against unused function warnings. The new combination of pm_ptr() EXPORT_GPL_RUNTIME_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the #ifdef guards. Note that we are replacing an unconditional call to the suspend and resume functions for sleep use cases with one via pm_runtime_force_suspend() / pm_runtime_force_resume() that only do anything to the device if we are not already in the appropriate runtime suspended state. Signed-off-by: Jonathan Cameron -- I 'think' this should be fine in that it can only reduce the number of unnecessary suspends. If anyone can test that would be great. Link: https://lore.kernel.org/r/20230114171620.42891-11-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/cyttsp4_core.c | 9 ++------- drivers/input/touchscreen/cyttsp4_i2c.c | 2 +- drivers/input/touchscreen/cyttsp4_spi.c | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c index dccbcb942fe5..0cd6f626adec 100644 --- a/drivers/input/touchscreen/cyttsp4_core.c +++ b/drivers/input/touchscreen/cyttsp4_core.c @@ -1744,7 +1744,6 @@ static void cyttsp4_free_si_ptrs(struct cyttsp4 *cd) kfree(si->btn_rec_data); } -#ifdef CONFIG_PM static int cyttsp4_core_sleep(struct cyttsp4 *cd) { int rc; @@ -1877,13 +1876,9 @@ static int cyttsp4_core_resume(struct device *dev) return 0; } -#endif -const struct dev_pm_ops cyttsp4_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(cyttsp4_core_suspend, cyttsp4_core_resume) - SET_RUNTIME_PM_OPS(cyttsp4_core_suspend, cyttsp4_core_resume, NULL) -}; -EXPORT_SYMBOL_GPL(cyttsp4_pm_ops); +EXPORT_GPL_RUNTIME_DEV_PM_OPS(cyttsp4_pm_ops, + cyttsp4_core_suspend, cyttsp4_core_resume, NULL); static int cyttsp4_mt_open(struct input_dev *input) { diff --git a/drivers/input/touchscreen/cyttsp4_i2c.c b/drivers/input/touchscreen/cyttsp4_i2c.c index c260bab0c62c..ec7a4779f3fb 100644 --- a/drivers/input/touchscreen/cyttsp4_i2c.c +++ b/drivers/input/touchscreen/cyttsp4_i2c.c @@ -58,7 +58,7 @@ MODULE_DEVICE_TABLE(i2c, cyttsp4_i2c_id); static struct i2c_driver cyttsp4_i2c_driver = { .driver = { .name = CYTTSP4_I2C_NAME, - .pm = &cyttsp4_pm_ops, + .pm = pm_ptr(&cyttsp4_pm_ops), }, .probe_new = cyttsp4_i2c_probe, .remove = cyttsp4_i2c_remove, diff --git a/drivers/input/touchscreen/cyttsp4_spi.c b/drivers/input/touchscreen/cyttsp4_spi.c index 5d7db84f2749..944fbbe9113e 100644 --- a/drivers/input/touchscreen/cyttsp4_spi.c +++ b/drivers/input/touchscreen/cyttsp4_spi.c @@ -173,7 +173,7 @@ static void cyttsp4_spi_remove(struct spi_device *spi) static struct spi_driver cyttsp4_spi_driver = { .driver = { .name = CYTTSP4_SPI_NAME, - .pm = &cyttsp4_pm_ops, + .pm = pm_ptr(&cyttsp4_pm_ops), }, .probe = cyttsp4_spi_probe, .remove = cyttsp4_spi_remove, -- cgit v1.2.3 From c3c2f2bc0c44cd3da542e2c48b680a3025661500 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sat, 14 Jan 2023 17:16:15 +0000 Subject: Input: cyttsp - use EXPORT_GPL_SIMPLE_DEV_PM_OPS() SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and EXPORT_GPL_SIMPLE_DEV_PMU_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. It also rolls in the EXPORT_SYMBOL() so that we only export it if CONFIG_PM_SLEEP. Signed-off-by: Jonathan Cameron Cc: Javier Martinez Canillas Cc: Linus Walleij Link: https://lore.kernel.org/r/20230114171620.42891-12-jic23@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/cyttsp_core.c | 7 +++---- drivers/input/touchscreen/cyttsp_i2c.c | 2 +- drivers/input/touchscreen/cyttsp_spi.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 1dbd849c9613..132ed5786e84 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -491,7 +491,7 @@ static int cyttsp_disable(struct cyttsp *ts) return 0; } -static int __maybe_unused cyttsp_suspend(struct device *dev) +static int cyttsp_suspend(struct device *dev) { struct cyttsp *ts = dev_get_drvdata(dev); int retval = 0; @@ -509,7 +509,7 @@ static int __maybe_unused cyttsp_suspend(struct device *dev) return retval; } -static int __maybe_unused cyttsp_resume(struct device *dev) +static int cyttsp_resume(struct device *dev) { struct cyttsp *ts = dev_get_drvdata(dev); @@ -525,8 +525,7 @@ static int __maybe_unused cyttsp_resume(struct device *dev) return 0; } -SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume); -EXPORT_SYMBOL_GPL(cyttsp_pm_ops); +EXPORT_GPL_SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume); static int cyttsp_open(struct input_dev *dev) { diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c index 0155a1626adf..3f91cb43ec82 100644 --- a/drivers/input/touchscreen/cyttsp_i2c.c +++ b/drivers/input/touchscreen/cyttsp_i2c.c @@ -63,7 +63,7 @@ MODULE_DEVICE_TABLE(of, cyttsp_of_i2c_match); static struct i2c_driver cyttsp_i2c_driver = { .driver = { .name = CY_I2C_NAME, - .pm = &cyttsp_pm_ops, + .pm = pm_sleep_ptr(&cyttsp_pm_ops), .of_match_table = cyttsp_of_i2c_match, }, .probe_new = cyttsp_i2c_probe, diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c index 30c6fbf86a86..ada17f2dadf3 100644 --- a/drivers/input/touchscreen/cyttsp_spi.c +++ b/drivers/input/touchscreen/cyttsp_spi.c @@ -172,7 +172,7 @@ MODULE_DEVICE_TABLE(of, cyttsp_of_spi_match); static struct spi_driver cyttsp_spi_driver = { .driver = { .name = CY_SPI_NAME, - .pm = &cyttsp_pm_ops, + .pm = pm_sleep_ptr(&cyttsp_pm_ops), .of_match_table = cyttsp_of_spi_match, }, .probe = cyttsp_spi_probe, -- cgit v1.2.3 From ac8810d2b6390df57f09c797b128e4eafe6c7332 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 17 Jan 2023 17:45:33 +0100 Subject: Input: ipaq-micro-ts - fix DEFINE_SIMPLE_DEV_PM_OPS typo The previous change was not properly build tested and needs a trivial spelling change: ipaq-micro-ts.c:146:8: error: type defaults to 'int' in declaration of 'DEFINE_SIMPLE_DEV_PM' [-Werror=implicit-int] Fixes: 144ff5e03d74 ("Input: ipaq-micro-ts - use DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()") Signed-off-by: Arnd Bergmann Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230117164539.1631336-1-arnd@kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ipaq-micro-ts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ipaq-micro-ts.c b/drivers/input/touchscreen/ipaq-micro-ts.c index d8e25b502968..94720c41c9be 100644 --- a/drivers/input/touchscreen/ipaq-micro-ts.c +++ b/drivers/input/touchscreen/ipaq-micro-ts.c @@ -143,8 +143,8 @@ static int micro_ts_resume(struct device *dev) return 0; } -static DEFINE_SIMPLE_DEV_PM(micro_ts_dev_pm_ops, - micro_ts_suspend, micro_ts_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(micro_ts_dev_pm_ops, + micro_ts_suspend, micro_ts_resume); static struct platform_driver micro_ts_device_driver = { .driver = { -- cgit v1.2.3 From d50584d783313c8b05b84d0b07a2142f1bde46dd Mon Sep 17 00:00:00 2001 From: Luca Ellero Date: Thu, 26 Jan 2023 11:52:25 +0100 Subject: Input: ads7846 - don't report pressure for ads7845 ADS7845 doesn't support pressure. Avoid the following error reported by libinput-list-devices: "ADS7845 Touchscreen: kernel bug: device has min == max on ABS_PRESSURE". Fixes: ffa458c1bd9b ("spi: ads7846 driver") Signed-off-by: Luca Ellero Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230126105227.47648-2-l.ellero@asem.it Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ads7846.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 4c3dd01902d0..f11b444f2138 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -1316,8 +1316,9 @@ static int ads7846_probe(struct spi_device *spi) pdata->y_min ? : 0, pdata->y_max ? : MAX_12BIT, 0, 0); - input_set_abs_params(input_dev, ABS_PRESSURE, - pdata->pressure_min, pdata->pressure_max, 0, 0); + if (ts->model != 7845) + input_set_abs_params(input_dev, ABS_PRESSURE, + pdata->pressure_min, pdata->pressure_max, 0, 0); /* * Parse common framework properties. Must be done here to ensure the -- cgit v1.2.3 From 13f82ca3878db8284a70ef9711d7f710a31eb562 Mon Sep 17 00:00:00 2001 From: Luca Ellero Date: Thu, 26 Jan 2023 11:52:26 +0100 Subject: Input: ads7846 - always set last command to PWRDOWN Controllers that report pressure (e.g. ADS7846) use 5 commands and the correct sequence is READ_X, READ_Y, READ_Z1, READ_Z2, PWRDOWN. Controllers that don't report pressure (e.g. ADS7845/ADS7843) use only 3 commands and the correct sequence should be READ_X, READ_Y, PWRDOWN. But the sequence sent was incorrect: READ_X, READ_Y, READ_Z1. Fix this by setting the third (and last) command to PWRDOWN. Fixes: ffa458c1bd9b ("spi: ads7846 driver") Signed-off-by: Luca Ellero Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230126105227.47648-3-l.ellero@asem.it Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ads7846.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index f11b444f2138..15da1047a577 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -1066,6 +1066,9 @@ static int ads7846_setup_spi_msg(struct ads7846 *ts, struct ads7846_buf_layout *l = &packet->l[cmd_idx]; unsigned int max_count; + if (cmd_idx == packet->cmds - 1) + cmd_idx = ADS7846_PWDOWN; + if (ads7846_cmd_need_settle(cmd_idx)) max_count = packet->count + packet->count_skip; else @@ -1102,7 +1105,12 @@ static int ads7846_setup_spi_msg(struct ads7846 *ts, for (cmd_idx = 0; cmd_idx < packet->cmds; cmd_idx++) { struct ads7846_buf_layout *l = &packet->l[cmd_idx]; - u8 cmd = ads7846_get_cmd(cmd_idx, vref); + u8 cmd; + + if (cmd_idx == packet->cmds - 1) + cmd_idx = ADS7846_PWDOWN; + + cmd = ads7846_get_cmd(cmd_idx, vref); for (b = 0; b < l->count; b++) packet->tx[l->offset + b].cmd = cmd; -- cgit v1.2.3 From fa9f4275b20ec7b2a8fb05c66362d10b36f9efec Mon Sep 17 00:00:00 2001 From: Luca Ellero Date: Thu, 26 Jan 2023 11:52:27 +0100 Subject: Input: ads7846 - don't check penirq immediately for 7845 To discard false readings, one should use "ti,penirq-recheck-delay-usecs". Checking get_pendown_state() at the beginning, most of the time fails causing malfunctioning. Fixes: ffa458c1bd9b ("spi: ads7846 driver") Signed-off-by: Luca Ellero Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230126105227.47648-4-l.ellero@asem.it Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ads7846.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 15da1047a577..17f11bce8113 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -843,14 +843,8 @@ static void ads7846_report_state(struct ads7846 *ts) if (x == MAX_12BIT) x = 0; - if (ts->model == 7843) { + if (ts->model == 7843 || ts->model == 7845) { Rt = ts->pressure_max / 2; - } else if (ts->model == 7845) { - if (get_pendown_state(ts)) - Rt = ts->pressure_max / 2; - else - Rt = 0; - dev_vdbg(&ts->spi->dev, "x/y: %d/%d, PD %d\n", x, y, Rt); } else if (likely(x && z1)) { /* compute touch pressure resistance using equation #2 */ Rt = z2; -- cgit v1.2.3 From 62c5e854b457c319c794a75cb378a7b47624e153 Mon Sep 17 00:00:00 2001 From: Dario Binacchi Date: Sun, 29 Jan 2023 18:31:15 -0800 Subject: Input: edt-ft5x06 - fix typo in a comment Replace 'firmares' with 'firmwares'. Signed-off-by: Dario Binacchi Link: https://lore.kernel.org/r/20230128162325.64467-1-dario.binacchi@amarulasolutions.com Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/edt-ft5x06.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index d09bfeaa7da6..2746649561c7 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -931,7 +931,7 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client, } else { /* If it is not an EDT M06/M12 touchscreen, then the model * detection is a bit hairy. The different ft5x06 - * firmares around don't reliably implement the + * firmwares around don't reliably implement the * identification registers. Well, we'll take a shot. * * The main difference between generic focaltec based -- cgit v1.2.3 From 79c81d137d36f9635bbcbc3916c0cccb418a61dd Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Feb 2023 16:43:29 -0800 Subject: Input: exc3000 - properly stop timer on shutdown We need to stop the timer on driver unbind or probe failures, otherwise we get UAF/Oops. Fixes: 7e577a17f2ee ("Input: add I2C attached EETI EXC3000 multi touch driver") Reported-by: "Stahl, Michael" Link: https://lore.kernel.org/r/Y9dK57BFqtlf8NmN@google.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/exc3000.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c index 4b7eee01c6aa..69eae79e2087 100644 --- a/drivers/input/touchscreen/exc3000.c +++ b/drivers/input/touchscreen/exc3000.c @@ -109,6 +109,11 @@ static inline void exc3000_schedule_timer(struct exc3000_data *data) mod_timer(&data->timer, jiffies + msecs_to_jiffies(EXC3000_TIMEOUT_MS)); } +static void exc3000_shutdown_timer(void *timer) +{ + timer_shutdown_sync(timer); +} + static int exc3000_read_frame(struct exc3000_data *data, u8 *buf) { struct i2c_client *client = data->client; @@ -386,6 +391,11 @@ static int exc3000_probe(struct i2c_client *client) if (error) return error; + error = devm_add_action_or_reset(&client->dev, exc3000_shutdown_timer, + &data->timer); + if (error) + return error; + error = devm_request_threaded_irq(&client->dev, client->irq, NULL, exc3000_interrupt, IRQF_ONESHOT, client->name, data); -- cgit v1.2.3 From 0424931431b5d593e602ec9c3ed35a34811d30d2 Mon Sep 17 00:00:00 2001 From: Richard Kjerstadius Date: Fri, 3 Feb 2023 16:57:05 -0800 Subject: Input: cyttsp5 - fix bitmask for touch buttons Prior to this patch, the bitmask ends up being 0x3, as opposed to 0x1 which likely was the intention. The erroneous bit results in the driver reporting 2 different button activations in designs with 2 or more buttons. To detect which button has been pressed, cyttsp5_btn_attention() uses a for loop to iterate through the input buffer, while shifting and applying a bitmask to determine the state for each button. Unfortunately, when the bitmask is 0x3 and there are multiple buttons, this procedure falls apart. Consider a design with 3 buttons. Pressing the third button will result in a call to cyttsp5_btn_attention() with the input buffer containing 0x4 (binary 0100). In the first iteration of the for loop cur_btn_state will be: (0x4 >> 0 * 1) & 0x3 = 0x4 & 0x3 = 0x0 This is correct. However, in the next iteration this happens: (0x4 >> 1 * 1) & 0x3 = 0x2 & 0x3 = 0x2 Which means that a key event for key 1 is generated, even though it's not really active. In the third iteration, the loop detects the button that was actually pressed: (0x4 >> 2 * 1) & 0x3 = 0x1 & 0x3 = 0x1 This key event is the only one that should have been detected, but it is accompanied by the preceding key. Ensuring the applied mask is 0x1 solves this problem. Signed-off-by: Richard Kjerstadius Reviewed-by: Alistair Francis Link: https://lore.kernel.org/r/20230127102903.3317089-1-richard.kjerstadius@teledyne.com Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/cyttsp5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/touchscreen') diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c index 4a23d6231382..16caffa35dd9 100644 --- a/drivers/input/touchscreen/cyttsp5.c +++ b/drivers/input/touchscreen/cyttsp5.c @@ -29,7 +29,7 @@ #define CY_MAX_INPUT 512 #define CYTTSP5_PREALLOCATED_CMD_BUFFER 32 #define CY_BITS_PER_BTN 1 -#define CY_NUM_BTN_EVENT_ID GENMASK(CY_BITS_PER_BTN, 0) +#define CY_NUM_BTN_EVENT_ID GENMASK(CY_BITS_PER_BTN - 1, 0) #define MAX_AREA 255 #define HID_OUTPUT_BL_SOP 0x1 -- cgit v1.2.3