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

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

authored by

Jisheng Zhang and committed by
Bartosz Golaszewski
07a251bf a92f492a

+4 -4
+4 -4
drivers/gpio/gpio-msc313.c
··· 694 694 * SoC goes into suspend to memory mode so we need to save some 695 695 * of the register bits before suspending and put it back when resuming 696 696 */ 697 - static int __maybe_unused msc313_gpio_suspend(struct device *dev) 697 + static int msc313_gpio_suspend(struct device *dev) 698 698 { 699 699 struct msc313_gpio *gpio = dev_get_drvdata(dev); 700 700 int i; ··· 705 705 return 0; 706 706 } 707 707 708 - static int __maybe_unused msc313_gpio_resume(struct device *dev) 708 + static int msc313_gpio_resume(struct device *dev) 709 709 { 710 710 struct msc313_gpio *gpio = dev_get_drvdata(dev); 711 711 int i; ··· 716 716 return 0; 717 717 } 718 718 719 - static SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume); 719 + static DEFINE_SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume); 720 720 721 721 static struct platform_driver msc313_gpio_driver = { 722 722 .driver = { 723 723 .name = DRIVER_NAME, 724 724 .of_match_table = msc313_gpio_of_match, 725 - .pm = &msc313_gpio_ops, 725 + .pm = pm_sleep_ptr(&msc313_gpio_ops), 726 726 }, 727 727 .probe = msc313_gpio_probe, 728 728 };