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>
pull/1354/merge
Jisheng Zhang 2025-11-24 08:21:00 +08:00 committed by Bartosz Golaszewski
parent 2b3c8bd8e1
commit 0ed358a87d
1 changed files with 6 additions and 6 deletions

View File

@ -171,7 +171,7 @@ static int pch_gpio_direction_input(struct gpio_chip *gpio, unsigned int nr)
/* /*
* Save register configuration and disable interrupts. * Save register configuration and disable interrupts.
*/ */
static void __maybe_unused pch_gpio_save_reg_conf(struct pch_gpio *chip) static void pch_gpio_save_reg_conf(struct pch_gpio *chip)
{ {
chip->pch_gpio_reg.ien_reg = ioread32(&chip->reg->ien); chip->pch_gpio_reg.ien_reg = ioread32(&chip->reg->ien);
chip->pch_gpio_reg.imask_reg = ioread32(&chip->reg->imask); chip->pch_gpio_reg.imask_reg = ioread32(&chip->reg->imask);
@ -187,7 +187,7 @@ static void __maybe_unused pch_gpio_save_reg_conf(struct pch_gpio *chip)
/* /*
* This function restores the register configuration of the GPIO device. * This function restores the register configuration of the GPIO device.
*/ */
static void __maybe_unused pch_gpio_restore_reg_conf(struct pch_gpio *chip) static void pch_gpio_restore_reg_conf(struct pch_gpio *chip)
{ {
iowrite32(chip->pch_gpio_reg.ien_reg, &chip->reg->ien); iowrite32(chip->pch_gpio_reg.ien_reg, &chip->reg->ien);
iowrite32(chip->pch_gpio_reg.imask_reg, &chip->reg->imask); iowrite32(chip->pch_gpio_reg.imask_reg, &chip->reg->imask);
@ -402,7 +402,7 @@ static int pch_gpio_probe(struct pci_dev *pdev,
return pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); return pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]);
} }
static int __maybe_unused pch_gpio_suspend(struct device *dev) static int pch_gpio_suspend(struct device *dev)
{ {
struct pch_gpio *chip = dev_get_drvdata(dev); struct pch_gpio *chip = dev_get_drvdata(dev);
unsigned long flags; unsigned long flags;
@ -414,7 +414,7 @@ static int __maybe_unused pch_gpio_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused pch_gpio_resume(struct device *dev) static int pch_gpio_resume(struct device *dev)
{ {
struct pch_gpio *chip = dev_get_drvdata(dev); struct pch_gpio *chip = dev_get_drvdata(dev);
unsigned long flags; unsigned long flags;
@ -428,7 +428,7 @@ static int __maybe_unused pch_gpio_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resume); static DEFINE_SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resume);
static const struct pci_device_id pch_gpio_pcidev_id[] = { static const struct pci_device_id pch_gpio_pcidev_id[] = {
{ PCI_DEVICE_DATA(INTEL, EG20T_PCH, INTEL_EG20T_PCH) }, { PCI_DEVICE_DATA(INTEL, EG20T_PCH, INTEL_EG20T_PCH) },
@ -444,7 +444,7 @@ static struct pci_driver pch_gpio_driver = {
.id_table = pch_gpio_pcidev_id, .id_table = pch_gpio_pcidev_id,
.probe = pch_gpio_probe, .probe = pch_gpio_probe,
.driver = { .driver = {
.pm = &pch_gpio_pm_ops, .pm = pm_sleep_ptr(&pch_gpio_pm_ops),
}, },
}; };