Skip to content

Commit 0ed358a

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
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>
1 parent 2b3c8bd commit 0ed358a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/gpio/gpio-pch.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static int pch_gpio_direction_input(struct gpio_chip *gpio, unsigned int nr)
171171
/*
172172
* Save register configuration and disable interrupts.
173173
*/
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)
175175
{
176176
chip->pch_gpio_reg.ien_reg = ioread32(&chip->reg->ien);
177177
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)
187187
/*
188188
* This function restores the register configuration of the GPIO device.
189189
*/
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)
191191
{
192192
iowrite32(chip->pch_gpio_reg.ien_reg, &chip->reg->ien);
193193
iowrite32(chip->pch_gpio_reg.imask_reg, &chip->reg->imask);
@@ -402,7 +402,7 @@ static int pch_gpio_probe(struct pci_dev *pdev,
402402
return pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]);
403403
}
404404

405-
static int __maybe_unused pch_gpio_suspend(struct device *dev)
405+
static int pch_gpio_suspend(struct device *dev)
406406
{
407407
struct pch_gpio *chip = dev_get_drvdata(dev);
408408
unsigned long flags;
@@ -414,7 +414,7 @@ static int __maybe_unused pch_gpio_suspend(struct device *dev)
414414
return 0;
415415
}
416416

417-
static int __maybe_unused pch_gpio_resume(struct device *dev)
417+
static int pch_gpio_resume(struct device *dev)
418418
{
419419
struct pch_gpio *chip = dev_get_drvdata(dev);
420420
unsigned long flags;
@@ -428,7 +428,7 @@ static int __maybe_unused pch_gpio_resume(struct device *dev)
428428
return 0;
429429
}
430430

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);
432432

433433
static const struct pci_device_id pch_gpio_pcidev_id[] = {
434434
{ PCI_DEVICE_DATA(INTEL, EG20T_PCH, INTEL_EG20T_PCH) },
@@ -444,7 +444,7 @@ static struct pci_driver pch_gpio_driver = {
444444
.id_table = pch_gpio_pcidev_id,
445445
.probe = pch_gpio_probe,
446446
.driver = {
447-
.pm = &pch_gpio_pm_ops,
447+
.pm = pm_sleep_ptr(&pch_gpio_pm_ops),
448448
},
449449
};
450450

0 commit comments

Comments
 (0)