diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-01-02 21:18:31 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-01-10 07:25:27 +0300 |
commit | 9fca27cffb9ffe988e76720213b49a9018b95020 (patch) | |
tree | 8d922401e003eac0b19324e3aadad2982398fc6c /drivers/input/touchscreen/raydium_i2c_ts.c | |
parent | add8bbd27acd4b246446fbb31ed7284c48d36200 (diff) | |
download | linux-9fca27cffb9ffe988e76720213b49a9018b95020.tar.xz |
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 <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-59-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/raydium_i2c_ts.c')
-rw-r--r-- | drivers/input/touchscreen/raydium_i2c_ts.c | 12 |
1 files changed, 6 insertions, 6 deletions
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), }, |