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

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

authored by

Jisheng Zhang and committed by
Bartosz Golaszewski
0ed358a8 2b3c8bd8

+6 -6
+6 -6
drivers/gpio/gpio-pch.c
··· 171 171 /* 172 172 * Save register configuration and disable interrupts. 173 173 */ 174 - static void __maybe_unused pch_gpio_save_reg_conf(struct pch_gpio *chip) 174 + static void pch_gpio_save_reg_conf(struct pch_gpio *chip) 175 175 { 176 176 chip->pch_gpio_reg.ien_reg = ioread32(&chip->reg->ien); 177 177 chip->pch_gpio_reg.imask_reg = ioread32(&chip->reg->imask); ··· 187 187 /* 188 188 * This function restores the register configuration of the GPIO device. 189 189 */ 190 - static void __maybe_unused pch_gpio_restore_reg_conf(struct pch_gpio *chip) 190 + static void pch_gpio_restore_reg_conf(struct pch_gpio *chip) 191 191 { 192 192 iowrite32(chip->pch_gpio_reg.ien_reg, &chip->reg->ien); 193 193 iowrite32(chip->pch_gpio_reg.imask_reg, &chip->reg->imask); ··· 402 402 return pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); 403 403 } 404 404 405 - static int __maybe_unused pch_gpio_suspend(struct device *dev) 405 + static int pch_gpio_suspend(struct device *dev) 406 406 { 407 407 struct pch_gpio *chip = dev_get_drvdata(dev); 408 408 unsigned long flags; ··· 414 414 return 0; 415 415 } 416 416 417 - static int __maybe_unused pch_gpio_resume(struct device *dev) 417 + static int pch_gpio_resume(struct device *dev) 418 418 { 419 419 struct pch_gpio *chip = dev_get_drvdata(dev); 420 420 unsigned long flags; ··· 428 428 return 0; 429 429 } 430 430 431 - static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resume); 431 + static DEFINE_SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resume); 432 432 433 433 static const struct pci_device_id pch_gpio_pcidev_id[] = { 434 434 { PCI_DEVICE_DATA(INTEL, EG20T_PCH, INTEL_EG20T_PCH) }, ··· 444 444 .id_table = pch_gpio_pcidev_id, 445 445 .probe = pch_gpio_probe, 446 446 .driver = { 447 - .pm = &pch_gpio_pm_ops, 447 + .pm = pm_sleep_ptr(&pch_gpio_pm_ops), 448 448 }, 449 449 }; 450 450