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

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

authored by

Jisheng Zhang and committed by
Bartosz Golaszewski
dbedf93d 353fdaeb

+7 -8
+7 -8
drivers/gpio/gpio-xilinx.c
··· 286 286 pm_runtime_put(chip->parent); 287 287 } 288 288 289 - static int __maybe_unused xgpio_suspend(struct device *dev) 289 + static int xgpio_suspend(struct device *dev) 290 290 { 291 291 struct xgpio_instance *gpio = dev_get_drvdata(dev); 292 292 struct irq_data *data = irq_get_irq_data(gpio->irq); ··· 327 327 { 328 328 } 329 329 330 - static int __maybe_unused xgpio_resume(struct device *dev) 330 + static int xgpio_resume(struct device *dev) 331 331 { 332 332 struct xgpio_instance *gpio = dev_get_drvdata(dev); 333 333 struct irq_data *data = irq_get_irq_data(gpio->irq); ··· 343 343 return 0; 344 344 } 345 345 346 - static int __maybe_unused xgpio_runtime_suspend(struct device *dev) 346 + static int xgpio_runtime_suspend(struct device *dev) 347 347 { 348 348 struct xgpio_instance *gpio = dev_get_drvdata(dev); 349 349 ··· 352 352 return 0; 353 353 } 354 354 355 - static int __maybe_unused xgpio_runtime_resume(struct device *dev) 355 + static int xgpio_runtime_resume(struct device *dev) 356 356 { 357 357 struct xgpio_instance *gpio = dev_get_drvdata(dev); 358 358 ··· 360 360 } 361 361 362 362 static const struct dev_pm_ops xgpio_dev_pm_ops = { 363 - SET_SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume) 364 - SET_RUNTIME_PM_OPS(xgpio_runtime_suspend, 365 - xgpio_runtime_resume, NULL) 363 + SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume) 364 + RUNTIME_PM_OPS(xgpio_runtime_suspend, xgpio_runtime_resume, NULL) 366 365 }; 367 366 368 367 /** ··· 681 682 .driver = { 682 683 .name = "gpio-xilinx", 683 684 .of_match_table = xgpio_of_match, 684 - .pm = &xgpio_dev_pm_ops, 685 + .pm = pm_ptr(&xgpio_dev_pm_ops), 685 686 }, 686 687 }; 687 688