]> Gentwo Git Trees - linux/.git/commitdiff
gpio: tqmx86: Use modern PM macros
authorJisheng Zhang <jszhang@kernel.org>
Mon, 24 Nov 2025 00:21:01 +0000 (08:21 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 25 Nov 2025 13:10:07 +0000 (14:10 +0100)
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>
Link: https://lore.kernel.org/r/20251124002105.25429-11-jszhang@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-tqmx86.c

index 27dd09273292a8db1b78c1f98aaa950b52d1e9be..eedfc0e371e3777335e9bee02a74a0ec837dbaab 100644 (file)
@@ -279,19 +279,18 @@ static void tqmx86_gpio_irq_handler(struct irq_desc *desc)
 }
 
 /* Minimal runtime PM is needed by the IRQ subsystem */
-static int __maybe_unused tqmx86_gpio_runtime_suspend(struct device *dev)
+static int tqmx86_gpio_runtime_suspend(struct device *dev)
 {
        return 0;
 }
 
-static int __maybe_unused tqmx86_gpio_runtime_resume(struct device *dev)
+static int tqmx86_gpio_runtime_resume(struct device *dev)
 {
        return 0;
 }
 
 static const struct dev_pm_ops tqmx86_gpio_dev_pm_ops = {
-       SET_RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend,
-                          tqmx86_gpio_runtime_resume, NULL)
+       RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend, tqmx86_gpio_runtime_resume, NULL)
 };
 
 static void tqmx86_init_irq_valid_mask(struct gpio_chip *chip,
@@ -425,7 +424,7 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
 static struct platform_driver tqmx86_gpio_driver = {
        .driver = {
                .name = "tqmx86-gpio",
-               .pm = &tqmx86_gpio_dev_pm_ops,
+               .pm = pm_ptr(&tqmx86_gpio_dev_pm_ops),
        },
        .probe          = tqmx86_gpio_probe,
 };