Skip to content

Commit 2b3c8bd

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
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>
1 parent 07a251b commit 2b3c8bd

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

drivers/gpio/gpio-omap.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ static void omap_gpio_remove(struct platform_device *pdev)
15031503
clk_unprepare(bank->dbck);
15041504
}
15051505

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

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

1532-
static int __maybe_unused omap_gpio_suspend(struct device *dev)
1532+
static int omap_gpio_suspend(struct device *dev)
15331533
{
15341534
struct gpio_bank *bank = dev_get_drvdata(dev);
15351535

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

1544-
static int __maybe_unused omap_gpio_resume(struct device *dev)
1544+
static int omap_gpio_resume(struct device *dev)
15451545
{
15461546
struct gpio_bank *bank = dev_get_drvdata(dev);
15471547

@@ -1554,17 +1554,16 @@ static int __maybe_unused omap_gpio_resume(struct device *dev)
15541554
}
15551555

15561556
static const struct dev_pm_ops gpio_pm_ops = {
1557-
SET_RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume,
1558-
NULL)
1559-
SET_LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume)
1557+
RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, NULL)
1558+
LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume)
15601559
};
15611560

15621561
static struct platform_driver omap_gpio_driver = {
15631562
.probe = omap_gpio_probe,
15641563
.remove = omap_gpio_remove,
15651564
.driver = {
15661565
.name = "omap_gpio",
1567-
.pm = &gpio_pm_ops,
1566+
.pm = pm_ptr(&gpio_pm_ops),
15681567
.of_match_table = omap_gpio_match,
15691568
},
15701569
};

0 commit comments

Comments
 (0)