Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jisheng Zhang and committed by
Bartosz Golaszewski
2b3c8bd8 07a251bf

+7 -8
+7 -8
drivers/gpio/gpio-omap.c
··· 1503 1503 clk_unprepare(bank->dbck); 1504 1504 } 1505 1505 1506 - static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev) 1506 + static int omap_gpio_runtime_suspend(struct device *dev) 1507 1507 { 1508 1508 struct gpio_bank *bank = dev_get_drvdata(dev); 1509 1509 unsigned long flags; ··· 1516 1516 return 0; 1517 1517 } 1518 1518 1519 - static int __maybe_unused omap_gpio_runtime_resume(struct device *dev) 1519 + static int omap_gpio_runtime_resume(struct device *dev) 1520 1520 { 1521 1521 struct gpio_bank *bank = dev_get_drvdata(dev); 1522 1522 unsigned long flags; ··· 1529 1529 return 0; 1530 1530 } 1531 1531 1532 - static int __maybe_unused omap_gpio_suspend(struct device *dev) 1532 + static int omap_gpio_suspend(struct device *dev) 1533 1533 { 1534 1534 struct gpio_bank *bank = dev_get_drvdata(dev); 1535 1535 ··· 1541 1541 return omap_gpio_runtime_suspend(dev); 1542 1542 } 1543 1543 1544 - static int __maybe_unused omap_gpio_resume(struct device *dev) 1544 + static int omap_gpio_resume(struct device *dev) 1545 1545 { 1546 1546 struct gpio_bank *bank = dev_get_drvdata(dev); 1547 1547 ··· 1554 1554 } 1555 1555 1556 1556 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) 1560 1559 }; 1561 1560 1562 1561 static struct platform_driver omap_gpio_driver = { ··· 1563 1564 .remove = omap_gpio_remove, 1564 1565 .driver = { 1565 1566 .name = "omap_gpio", 1566 - .pm = &gpio_pm_ops, 1567 + .pm = pm_ptr(&gpio_pm_ops), 1567 1568 .of_match_table = omap_gpio_match, 1568 1569 }, 1569 1570 };