Skip to content

Commit 23ac52a

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
gpio: zynq: 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-15-jszhang@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent dbedf93 commit 23ac52a

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

drivers/gpio/gpio-zynq.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
735735
}
736736
}
737737

738-
static int __maybe_unused zynq_gpio_suspend(struct device *dev)
738+
static int zynq_gpio_suspend(struct device *dev)
739739
{
740740
struct zynq_gpio *gpio = dev_get_drvdata(dev);
741741
struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -756,7 +756,7 @@ static int __maybe_unused zynq_gpio_suspend(struct device *dev)
756756
return 0;
757757
}
758758

759-
static int __maybe_unused zynq_gpio_resume(struct device *dev)
759+
static int zynq_gpio_resume(struct device *dev)
760760
{
761761
struct zynq_gpio *gpio = dev_get_drvdata(dev);
762762
struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -779,7 +779,7 @@ static int __maybe_unused zynq_gpio_resume(struct device *dev)
779779
return 0;
780780
}
781781

782-
static int __maybe_unused zynq_gpio_runtime_suspend(struct device *dev)
782+
static int zynq_gpio_runtime_suspend(struct device *dev)
783783
{
784784
struct zynq_gpio *gpio = dev_get_drvdata(dev);
785785

@@ -788,7 +788,7 @@ static int __maybe_unused zynq_gpio_runtime_suspend(struct device *dev)
788788
return 0;
789789
}
790790

791-
static int __maybe_unused zynq_gpio_runtime_resume(struct device *dev)
791+
static int zynq_gpio_runtime_resume(struct device *dev)
792792
{
793793
struct zynq_gpio *gpio = dev_get_drvdata(dev);
794794

@@ -814,9 +814,8 @@ static void zynq_gpio_free(struct gpio_chip *chip, unsigned int offset)
814814
}
815815

816816
static const struct dev_pm_ops zynq_gpio_dev_pm_ops = {
817-
SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume)
818-
SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
819-
zynq_gpio_runtime_resume, NULL)
817+
SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume)
818+
RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, zynq_gpio_runtime_resume, NULL)
820819
};
821820

822821
static const struct zynq_platform_data versal_gpio_def = {
@@ -1022,7 +1021,7 @@ static void zynq_gpio_remove(struct platform_device *pdev)
10221021
static struct platform_driver zynq_gpio_driver = {
10231022
.driver = {
10241023
.name = DRIVER_NAME,
1025-
.pm = &zynq_gpio_dev_pm_ops,
1024+
.pm = pm_ptr(&zynq_gpio_dev_pm_ops),
10261025
.of_match_table = zynq_gpio_of_match,
10271026
},
10281027
.probe = zynq_gpio_probe,

0 commit comments

Comments
 (0)