Skip to content

Commit 46e90d3

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
gpio: uniphier: 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-12-jszhang@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 75ff162 commit 46e90d3

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/gpio/gpio-uniphier.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static void uniphier_gpio_remove(struct platform_device *pdev)
426426
irq_domain_remove(priv->domain);
427427
}
428428

429-
static int __maybe_unused uniphier_gpio_suspend(struct device *dev)
429+
static int uniphier_gpio_suspend(struct device *dev)
430430
{
431431
struct uniphier_gpio_priv *priv = dev_get_drvdata(dev);
432432
unsigned int nbanks = uniphier_gpio_get_nbanks(priv->chip.ngpio);
@@ -448,7 +448,7 @@ static int __maybe_unused uniphier_gpio_suspend(struct device *dev)
448448
return 0;
449449
}
450450

451-
static int __maybe_unused uniphier_gpio_resume(struct device *dev)
451+
static int uniphier_gpio_resume(struct device *dev)
452452
{
453453
struct uniphier_gpio_priv *priv = dev_get_drvdata(dev);
454454
unsigned int nbanks = uniphier_gpio_get_nbanks(priv->chip.ngpio);
@@ -473,8 +473,7 @@ static int __maybe_unused uniphier_gpio_resume(struct device *dev)
473473
}
474474

475475
static const struct dev_pm_ops uniphier_gpio_pm_ops = {
476-
SET_LATE_SYSTEM_SLEEP_PM_OPS(uniphier_gpio_suspend,
477-
uniphier_gpio_resume)
476+
LATE_SYSTEM_SLEEP_PM_OPS(uniphier_gpio_suspend, uniphier_gpio_resume)
478477
};
479478

480479
static const struct of_device_id uniphier_gpio_match[] = {
@@ -489,7 +488,7 @@ static struct platform_driver uniphier_gpio_driver = {
489488
.driver = {
490489
.name = "uniphier-gpio",
491490
.of_match_table = uniphier_gpio_match,
492-
.pm = &uniphier_gpio_pm_ops,
491+
.pm = pm_sleep_ptr(&uniphier_gpio_pm_ops),
493492
},
494493
};
495494
module_platform_driver(uniphier_gpio_driver);

0 commit comments

Comments
 (0)