Commit 2b3c8bd8 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Bartosz Golaszewski
Browse files

gpio: omap: Use modern PM macros



Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused

Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/r/20251124002105.25429-9-jszhang@kernel.org


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 07a251bf
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -1503,7 +1503,7 @@ static void omap_gpio_remove(struct platform_device *pdev)
		clk_unprepare(bank->dbck);
}

static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev)
static int omap_gpio_runtime_suspend(struct device *dev)
{
	struct gpio_bank *bank = dev_get_drvdata(dev);
	unsigned long flags;
@@ -1516,7 +1516,7 @@ static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev)
	return 0;
}

static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
static int omap_gpio_runtime_resume(struct device *dev)
{
	struct gpio_bank *bank = dev_get_drvdata(dev);
	unsigned long flags;
@@ -1529,7 +1529,7 @@ static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
	return 0;
}

static int __maybe_unused omap_gpio_suspend(struct device *dev)
static int omap_gpio_suspend(struct device *dev)
{
	struct gpio_bank *bank = dev_get_drvdata(dev);

@@ -1541,7 +1541,7 @@ static int __maybe_unused omap_gpio_suspend(struct device *dev)
	return omap_gpio_runtime_suspend(dev);
}

static int __maybe_unused omap_gpio_resume(struct device *dev)
static int omap_gpio_resume(struct device *dev)
{
	struct gpio_bank *bank = dev_get_drvdata(dev);

@@ -1554,9 +1554,8 @@ static int __maybe_unused omap_gpio_resume(struct device *dev)
}

static const struct dev_pm_ops gpio_pm_ops = {
	SET_RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume,
									NULL)
	SET_LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume)
	RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, NULL)
	LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume)
};

static struct platform_driver omap_gpio_driver = {
@@ -1564,7 +1563,7 @@ static struct platform_driver omap_gpio_driver = {
	.remove		= omap_gpio_remove,
	.driver		= {
		.name	= "omap_gpio",
		.pm	= &gpio_pm_ops,
		.pm	= pm_ptr(&gpio_pm_ops),
		.of_match_table = omap_gpio_match,
	},
};