Commit 6ec75b20 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: adp5588-keys - drop CONFIG_PM guards

To improve compile-time coverage let's drop #ifdef CONFIG_PM guards
and use SIMPLE_DEV_PM_OPS and __maybe_unused attributes and rely on
the linker to drop unused code.
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20220528045631.289821-1-dmitry.torokhov@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent ba0f3214
...@@ -612,8 +612,7 @@ static int adp5588_remove(struct i2c_client *client) ...@@ -612,8 +612,7 @@ static int adp5588_remove(struct i2c_client *client)
return 0; return 0;
} }
#ifdef CONFIG_PM static int __maybe_unused adp5588_suspend(struct device *dev)
static int adp5588_suspend(struct device *dev)
{ {
struct adp5588_kpad *kpad = dev_get_drvdata(dev); struct adp5588_kpad *kpad = dev_get_drvdata(dev);
struct i2c_client *client = kpad->client; struct i2c_client *client = kpad->client;
...@@ -627,7 +626,7 @@ static int adp5588_suspend(struct device *dev) ...@@ -627,7 +626,7 @@ static int adp5588_suspend(struct device *dev)
return 0; return 0;
} }
static int adp5588_resume(struct device *dev) static int __maybe_unused adp5588_resume(struct device *dev)
{ {
struct adp5588_kpad *kpad = dev_get_drvdata(dev); struct adp5588_kpad *kpad = dev_get_drvdata(dev);
struct i2c_client *client = kpad->client; struct i2c_client *client = kpad->client;
...@@ -640,11 +639,7 @@ static int adp5588_resume(struct device *dev) ...@@ -640,11 +639,7 @@ static int adp5588_resume(struct device *dev)
return 0; return 0;
} }
static const struct dev_pm_ops adp5588_dev_pm_ops = { static SIMPLE_DEV_PM_OPS(adp5588_dev_pm_ops, adp5588_suspend, adp5588_resume);
.suspend = adp5588_suspend,
.resume = adp5588_resume,
};
#endif
static const struct i2c_device_id adp5588_id[] = { static const struct i2c_device_id adp5588_id[] = {
{ "adp5588-keys", 0 }, { "adp5588-keys", 0 },
...@@ -656,9 +651,7 @@ MODULE_DEVICE_TABLE(i2c, adp5588_id); ...@@ -656,9 +651,7 @@ MODULE_DEVICE_TABLE(i2c, adp5588_id);
static struct i2c_driver adp5588_driver = { static struct i2c_driver adp5588_driver = {
.driver = { .driver = {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
#ifdef CONFIG_PM
.pm = &adp5588_dev_pm_ops, .pm = &adp5588_dev_pm_ops,
#endif
}, },
.probe = adp5588_probe, .probe = adp5588_probe,
.remove = adp5588_remove, .remove = adp5588_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment