Skip to content

Commit 1f37a9f

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
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>
1 parent b40c4da commit 1f37a9f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/gpio/gpio-ml-ioh.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static int ioh_gpio_direction_input(struct gpio_chip *gpio, unsigned nr)
160160
/*
161161
* Save register configuration and disable interrupts.
162162
*/
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)
164164
{
165165
int i;
166166

@@ -186,7 +186,7 @@ static void __maybe_unused ioh_gpio_save_reg_conf(struct ioh_gpio *chip)
186186
/*
187187
* This function restores the register configuration of the GPIO device.
188188
*/
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)
190190
{
191191
int i;
192192

@@ -479,7 +479,7 @@ static int ioh_gpio_probe(struct pci_dev *pdev,
479479
return 0;
480480
}
481481

482-
static int __maybe_unused ioh_gpio_suspend(struct device *dev)
482+
static int ioh_gpio_suspend(struct device *dev)
483483
{
484484
struct ioh_gpio *chip = dev_get_drvdata(dev);
485485
unsigned long flags;
@@ -491,7 +491,7 @@ static int __maybe_unused ioh_gpio_suspend(struct device *dev)
491491
return 0;
492492
}
493493

494-
static int __maybe_unused ioh_gpio_resume(struct device *dev)
494+
static int ioh_gpio_resume(struct device *dev)
495495
{
496496
struct ioh_gpio *chip = dev_get_drvdata(dev);
497497
unsigned long flags;
@@ -505,7 +505,7 @@ static int __maybe_unused ioh_gpio_resume(struct device *dev)
505505
return 0;
506506
}
507507

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

510510
static const struct pci_device_id ioh_gpio_pcidev_id[] = {
511511
{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x802E) },
@@ -518,7 +518,7 @@ static struct pci_driver ioh_gpio_driver = {
518518
.id_table = ioh_gpio_pcidev_id,
519519
.probe = ioh_gpio_probe,
520520
.driver = {
521-
.pm = &ioh_gpio_pm_ops,
521+
.pm = pm_sleep_ptr(&ioh_gpio_pm_ops),
522522
},
523523
};
524524

0 commit comments

Comments
 (0)