]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: mlxbf2: Use modern PM macros
authorJisheng Zhang <jszhang@kernel.org>
Mon, 24 Nov 2025 00:20:57 +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-7-jszhang@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-mlxbf2.c

index abffce3894fc44f9b75ad2b15e84aabaf3fd23eb..6668686a28ffe392699f45e3c2bc2bd015a897cb 100644 (file)
@@ -424,7 +424,7 @@ mlxbf2_gpio_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int __maybe_unused mlxbf2_gpio_suspend(struct device *dev)
+static int mlxbf2_gpio_suspend(struct device *dev)
 {
        struct mlxbf2_gpio_context *gs = dev_get_drvdata(dev);
 
@@ -436,7 +436,7 @@ static int __maybe_unused mlxbf2_gpio_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused mlxbf2_gpio_resume(struct device *dev)
+static int mlxbf2_gpio_resume(struct device *dev)
 {
        struct mlxbf2_gpio_context *gs = dev_get_drvdata(dev);
 
@@ -447,7 +447,7 @@ static int __maybe_unused mlxbf2_gpio_resume(struct device *dev)
 
        return 0;
 }
-static SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_resume);
 
 static const struct acpi_device_id __maybe_unused mlxbf2_gpio_acpi_match[] = {
        { "MLNXBF22", 0 },
@@ -459,7 +459,7 @@ static struct platform_driver mlxbf2_gpio_driver = {
        .driver = {
                .name = "mlxbf2_gpio",
                .acpi_match_table = mlxbf2_gpio_acpi_match,
-               .pm = &mlxbf2_pm_ops,
+               .pm = pm_sleep_ptr(&mlxbf2_pm_ops),
        },
        .probe    = mlxbf2_gpio_probe,
 };