diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-01-02 21:17:51 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-01-10 07:25:22 +0300 |
commit | a410677f4042a7f84644173a893780daee34ff3f (patch) | |
tree | 14b3ed50e7770ae81a517f5ffa5925a780028fa9 /drivers/input | |
parent | 37aee5951f55561bd30b4cc937419a5288f93103 (diff) | |
download | linux-a410677f4042a7f84644173a893780daee34ff3f.tar.xz |
Input: pmic8xxx-pwrkey - 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: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-19-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/pmic8xxx-pwrkey.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c index 0e818a3d28c5..89fb137e3715 100644 --- a/drivers/input/misc/pmic8xxx-pwrkey.c +++ b/drivers/input/misc/pmic8xxx-pwrkey.c @@ -100,7 +100,7 @@ static irqreturn_t pwrkey_release_irq(int irq, void *_pwr) return IRQ_HANDLED; } -static int __maybe_unused pmic8xxx_pwrkey_suspend(struct device *dev) +static int pmic8xxx_pwrkey_suspend(struct device *dev) { struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev); @@ -110,7 +110,7 @@ static int __maybe_unused pmic8xxx_pwrkey_suspend(struct device *dev) return 0; } -static int __maybe_unused pmic8xxx_pwrkey_resume(struct device *dev) +static int pmic8xxx_pwrkey_resume(struct device *dev) { struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev); @@ -120,7 +120,7 @@ static int __maybe_unused pmic8xxx_pwrkey_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops, +static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops, pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume); static void pmic8xxx_pwrkey_shutdown(struct platform_device *pdev) @@ -442,7 +442,7 @@ static struct platform_driver pmic8xxx_pwrkey_driver = { .shutdown = pmic8xxx_pwrkey_shutdown, .driver = { .name = "pm8xxx-pwrkey", - .pm = &pm8xxx_pwr_key_pm_ops, + .pm = pm_sleep_ptr(&pm8xxx_pwr_key_pm_ops), .of_match_table = pm8xxx_pwr_key_id_table, }, }; |