mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
Input: pcfg8574_keypad - 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 <Jonathan.Cameron@huawei.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230102181842.718010-16-jic23@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
77c52d40cf
commit
22db998afd
1 changed files with 3 additions and 13 deletions
|
@ -167,7 +167,6 @@ static void pcf8574_kp_remove(struct i2c_client *client)
|
||||||
kfree(lp);
|
kfree(lp);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
static int pcf8574_kp_resume(struct device *dev)
|
static int pcf8574_kp_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct i2c_client *client = to_i2c_client(dev);
|
struct i2c_client *client = to_i2c_client(dev);
|
||||||
|
@ -186,15 +185,8 @@ static int pcf8574_kp_suspend(struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dev_pm_ops pcf8574_kp_pm_ops = {
|
static DEFINE_SIMPLE_DEV_PM_OPS(pcf8574_kp_pm_ops,
|
||||||
.suspend = pcf8574_kp_suspend,
|
pcf8574_kp_suspend, pcf8574_kp_resume);
|
||||||
.resume = pcf8574_kp_resume,
|
|
||||||
};
|
|
||||||
|
|
||||||
#else
|
|
||||||
# define pcf8574_kp_resume NULL
|
|
||||||
# define pcf8574_kp_suspend NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct i2c_device_id pcf8574_kp_id[] = {
|
static const struct i2c_device_id pcf8574_kp_id[] = {
|
||||||
{ DRV_NAME, 0 },
|
{ DRV_NAME, 0 },
|
||||||
|
@ -205,9 +197,7 @@ MODULE_DEVICE_TABLE(i2c, pcf8574_kp_id);
|
||||||
static struct i2c_driver pcf8574_kp_driver = {
|
static struct i2c_driver pcf8574_kp_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = DRV_NAME,
|
.name = DRV_NAME,
|
||||||
#ifdef CONFIG_PM
|
.pm = pm_sleep_ptr(&pcf8574_kp_pm_ops),
|
||||||
.pm = &pcf8574_kp_pm_ops,
|
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
.probe_new = pcf8574_kp_probe,
|
.probe_new = pcf8574_kp_probe,
|
||||||
.remove = pcf8574_kp_remove,
|
.remove = pcf8574_kp_remove,
|
||||||
|
|
Loading…
Reference in a new issue