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

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

authored by

Jisheng Zhang and committed by
Bartosz Golaszewski
353fdaeb 46e90d39

+4 -4
+4 -4
drivers/gpio/gpio-xgene.c
··· 130 130 return 0; 131 131 } 132 132 133 - static __maybe_unused int xgene_gpio_suspend(struct device *dev) 133 + static int xgene_gpio_suspend(struct device *dev) 134 134 { 135 135 struct xgene_gpio *gpio = dev_get_drvdata(dev); 136 136 unsigned long bank_offset; ··· 143 143 return 0; 144 144 } 145 145 146 - static __maybe_unused int xgene_gpio_resume(struct device *dev) 146 + static int xgene_gpio_resume(struct device *dev) 147 147 { 148 148 struct xgene_gpio *gpio = dev_get_drvdata(dev); 149 149 unsigned long bank_offset; ··· 156 156 return 0; 157 157 } 158 158 159 - static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume); 159 + static DEFINE_SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume); 160 160 161 161 static int xgene_gpio_probe(struct platform_device *pdev) 162 162 { ··· 204 204 .name = "xgene-gpio", 205 205 .of_match_table = xgene_gpio_of_match, 206 206 .acpi_match_table = ACPI_PTR(xgene_gpio_acpi_match), 207 - .pm = &xgene_gpio_pm, 207 + .pm = pm_sleep_ptr(&xgene_gpio_pm), 208 208 }, 209 209 .probe = xgene_gpio_probe, 210 210 };