Commit 1f37a9f7 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Bartosz Golaszewski
Browse files

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: default avatarJisheng Zhang <jszhang@kernel.org>
Acked-by: default avatarAndy Shevchenko <andy@kernel.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/r/20251124002105.25429-6-jszhang@kernel.org


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent b40c4dac
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static int ioh_gpio_direction_input(struct gpio_chip *gpio, unsigned nr)
/*
 * Save register configuration and disable interrupts.
 */
static void __maybe_unused ioh_gpio_save_reg_conf(struct ioh_gpio *chip)
static void ioh_gpio_save_reg_conf(struct ioh_gpio *chip)
{
	int i;

@@ -186,7 +186,7 @@ static void __maybe_unused ioh_gpio_save_reg_conf(struct ioh_gpio *chip)
/*
 * This function restores the register configuration of the GPIO device.
 */
static void __maybe_unused ioh_gpio_restore_reg_conf(struct ioh_gpio *chip)
static void ioh_gpio_restore_reg_conf(struct ioh_gpio *chip)
{
	int i;

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

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

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

static SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpio_resume);
static DEFINE_SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpio_resume);

static const struct pci_device_id ioh_gpio_pcidev_id[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x802E) },
@@ -518,7 +518,7 @@ static struct pci_driver ioh_gpio_driver = {
	.id_table = ioh_gpio_pcidev_id,
	.probe = ioh_gpio_probe,
	.driver = {
		.pm = &ioh_gpio_pm_ops,
		.pm = pm_sleep_ptr(&ioh_gpio_pm_ops),
	},
};