]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: msc313: Use modern PM macros
authorJisheng Zhang <jszhang@kernel.org>
Mon, 24 Nov 2025 00:20:58 +0000 (08:20 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 25 Nov 2025 13:10:06 +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>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/r/20251124002105.25429-8-jszhang@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-msc313.c

index b0cccd856840987cb25fd0c4fa1ad34b00941fa8..7345afdc78de3123fd6134cc194ac3fbddf83e59 100644 (file)
@@ -694,7 +694,7 @@ static const struct of_device_id msc313_gpio_of_match[] = {
  * SoC goes into suspend to memory mode so we need to save some
  * of the register bits before suspending and put it back when resuming
  */
-static int __maybe_unused msc313_gpio_suspend(struct device *dev)
+static int msc313_gpio_suspend(struct device *dev)
 {
        struct msc313_gpio *gpio = dev_get_drvdata(dev);
        int i;
@@ -705,7 +705,7 @@ static int __maybe_unused msc313_gpio_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused msc313_gpio_resume(struct device *dev)
+static int msc313_gpio_resume(struct device *dev)
 {
        struct msc313_gpio *gpio = dev_get_drvdata(dev);
        int i;
@@ -716,13 +716,13 @@ static int __maybe_unused msc313_gpio_resume(struct device *dev)
        return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume);
 
 static struct platform_driver msc313_gpio_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .of_match_table = msc313_gpio_of_match,
-               .pm = &msc313_gpio_ops,
+               .pm = pm_sleep_ptr(&msc313_gpio_ops),
        },
        .probe = msc313_gpio_probe,
 };