Commit ba4de5d9 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Dmitry Torokhov
Browse files

Input: gpio-keys - 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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20221204180841.2211588-7-jic23@kernel.org


Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 64bc2732
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -992,7 +992,7 @@ gpio_keys_disable_wakeup(struct gpio_keys_drvdata *ddata)
	}
}

static int __maybe_unused gpio_keys_suspend(struct device *dev)
static int gpio_keys_suspend(struct device *dev)
{
	struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
	struct input_dev *input = ddata->input;
@@ -1012,7 +1012,7 @@ static int __maybe_unused gpio_keys_suspend(struct device *dev)
	return 0;
}

static int __maybe_unused gpio_keys_resume(struct device *dev)
static int gpio_keys_resume(struct device *dev)
{
	struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev);
	struct input_dev *input = ddata->input;
@@ -1034,7 +1034,7 @@ static int __maybe_unused gpio_keys_resume(struct device *dev)
	return 0;
}

static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);
static DEFINE_SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume);

static void gpio_keys_shutdown(struct platform_device *pdev)
{
@@ -1050,7 +1050,7 @@ static struct platform_driver gpio_keys_device_driver = {
	.shutdown	= gpio_keys_shutdown,
	.driver		= {
		.name	= "gpio-keys",
		.pm	= &gpio_keys_pm_ops,
		.pm	= pm_sleep_ptr(&gpio_keys_pm_ops),
		.of_match_table = gpio_keys_of_match,
		.dev_groups	= gpio_keys_groups,
	}