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

Configure Feed

Select the types of activity you want to include in your feed.

gpio: mlxbf2: 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-7-jszhang@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Jisheng Zhang and committed by
Bartosz Golaszewski
a92f492a 1f37a9f7

+4 -4
+4 -4
drivers/gpio/gpio-mlxbf2.c
··· 424 424 return 0; 425 425 } 426 426 427 - static int __maybe_unused mlxbf2_gpio_suspend(struct device *dev) 427 + static int mlxbf2_gpio_suspend(struct device *dev) 428 428 { 429 429 struct mlxbf2_gpio_context *gs = dev_get_drvdata(dev); 430 430 ··· 436 436 return 0; 437 437 } 438 438 439 - static int __maybe_unused mlxbf2_gpio_resume(struct device *dev) 439 + static int mlxbf2_gpio_resume(struct device *dev) 440 440 { 441 441 struct mlxbf2_gpio_context *gs = dev_get_drvdata(dev); 442 442 ··· 447 447 448 448 return 0; 449 449 } 450 - static SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_resume); 450 + static DEFINE_SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_resume); 451 451 452 452 static const struct acpi_device_id __maybe_unused mlxbf2_gpio_acpi_match[] = { 453 453 { "MLNXBF22", 0 }, ··· 459 459 .driver = { 460 460 .name = "mlxbf2_gpio", 461 461 .acpi_match_table = mlxbf2_gpio_acpi_match, 462 - .pm = &mlxbf2_pm_ops, 462 + .pm = pm_sleep_ptr(&mlxbf2_pm_ops), 463 463 }, 464 464 .probe = mlxbf2_gpio_probe, 465 465 };