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: Jisheng Zhang <jszhang@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://lore.kernel.org/r/20251124002105.25429-9-jszhang@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>pull/1354/merge
parent
07a251bfe3
commit
2b3c8bd8e1
|
|
@ -1503,7 +1503,7 @@ static void omap_gpio_remove(struct platform_device *pdev)
|
||||||
clk_unprepare(bank->dbck);
|
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);
|
struct gpio_bank *bank = dev_get_drvdata(dev);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
@ -1516,7 +1516,7 @@ static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev)
|
||||||
return 0;
|
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);
|
struct gpio_bank *bank = dev_get_drvdata(dev);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
@ -1529,7 +1529,7 @@ static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
|
||||||
return 0;
|
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);
|
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);
|
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);
|
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 = {
|
static const struct dev_pm_ops gpio_pm_ops = {
|
||||||
SET_RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume,
|
RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, NULL)
|
||||||
NULL)
|
LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume)
|
||||||
SET_LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_driver omap_gpio_driver = {
|
static struct platform_driver omap_gpio_driver = {
|
||||||
|
|
@ -1564,7 +1563,7 @@ static struct platform_driver omap_gpio_driver = {
|
||||||
.remove = omap_gpio_remove,
|
.remove = omap_gpio_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "omap_gpio",
|
.name = "omap_gpio",
|
||||||
.pm = &gpio_pm_ops,
|
.pm = pm_ptr(&gpio_pm_ops),
|
||||||
.of_match_table = omap_gpio_match,
|
.of_match_table = omap_gpio_match,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue