Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <Jonathan.Cameron@huawei.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Bastien Nocera <hadess@hadess.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-47-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
05ebb78b df0f6734

+4 -4
+4 -4
drivers/input/touchscreen/goodix.c
··· 1390 1390 wait_for_completion(&ts->firmware_loading_complete); 1391 1391 } 1392 1392 1393 - static int __maybe_unused goodix_suspend(struct device *dev) 1393 + static int goodix_suspend(struct device *dev) 1394 1394 { 1395 1395 struct i2c_client *client = to_i2c_client(dev); 1396 1396 struct goodix_ts_data *ts = i2c_get_clientdata(client); ··· 1437 1437 return 0; 1438 1438 } 1439 1439 1440 - static int __maybe_unused goodix_resume(struct device *dev) 1440 + static int goodix_resume(struct device *dev) 1441 1441 { 1442 1442 struct i2c_client *client = to_i2c_client(dev); 1443 1443 struct goodix_ts_data *ts = i2c_get_clientdata(client); ··· 1486 1486 return 0; 1487 1487 } 1488 1488 1489 - static SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume); 1489 + static DEFINE_SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume); 1490 1490 1491 1491 static const struct i2c_device_id goodix_ts_id[] = { 1492 1492 { "GDIX1001:00", 0 }, ··· 1532 1532 .name = "Goodix-TS", 1533 1533 .acpi_match_table = ACPI_PTR(goodix_acpi_match), 1534 1534 .of_match_table = of_match_ptr(goodix_of_match), 1535 - .pm = &goodix_pm_ops, 1535 + .pm = pm_sleep_ptr(&goodix_pm_ops), 1536 1536 }, 1537 1537 }; 1538 1538 module_i2c_driver(goodix_ts_driver);