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

gpio: ml-ioh: 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: Andy Shevchenko <andy@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-6-jszhang@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Jisheng Zhang and committed by
Bartosz Golaszewski
1f37a9f7 b40c4dac

+6 -6
+6 -6
drivers/gpio/gpio-ml-ioh.c
··· 160 160 /* 161 161 * Save register configuration and disable interrupts. 162 162 */ 163 - static void __maybe_unused ioh_gpio_save_reg_conf(struct ioh_gpio *chip) 163 + static void ioh_gpio_save_reg_conf(struct ioh_gpio *chip) 164 164 { 165 165 int i; 166 166 ··· 186 186 /* 187 187 * This function restores the register configuration of the GPIO device. 188 188 */ 189 - static void __maybe_unused ioh_gpio_restore_reg_conf(struct ioh_gpio *chip) 189 + static void ioh_gpio_restore_reg_conf(struct ioh_gpio *chip) 190 190 { 191 191 int i; 192 192 ··· 479 479 return 0; 480 480 } 481 481 482 - static int __maybe_unused ioh_gpio_suspend(struct device *dev) 482 + static int ioh_gpio_suspend(struct device *dev) 483 483 { 484 484 struct ioh_gpio *chip = dev_get_drvdata(dev); 485 485 unsigned long flags; ··· 491 491 return 0; 492 492 } 493 493 494 - static int __maybe_unused ioh_gpio_resume(struct device *dev) 494 + static int ioh_gpio_resume(struct device *dev) 495 495 { 496 496 struct ioh_gpio *chip = dev_get_drvdata(dev); 497 497 unsigned long flags; ··· 505 505 return 0; 506 506 } 507 507 508 - static SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpio_resume); 508 + static DEFINE_SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpio_resume); 509 509 510 510 static const struct pci_device_id ioh_gpio_pcidev_id[] = { 511 511 { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x802E) }, ··· 518 518 .id_table = ioh_gpio_pcidev_id, 519 519 .probe = ioh_gpio_probe, 520 520 .driver = { 521 - .pm = &ioh_gpio_pm_ops, 521 + .pm = pm_sleep_ptr(&ioh_gpio_pm_ops), 522 522 }, 523 523 }; 524 524