gpio: xilinx: 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: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/r/20251124002105.25429-14-jszhang@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
Jisheng Zhang
2025-11-24 08:21:04 +08:00
committed by Bartosz Golaszewski
parent 353fdaebdc
commit dbedf93d10

View File

@@ -286,7 +286,7 @@ static void xgpio_free(struct gpio_chip *chip, unsigned int offset)
pm_runtime_put(chip->parent); pm_runtime_put(chip->parent);
} }
static int __maybe_unused xgpio_suspend(struct device *dev) static int xgpio_suspend(struct device *dev)
{ {
struct xgpio_instance *gpio = dev_get_drvdata(dev); struct xgpio_instance *gpio = dev_get_drvdata(dev);
struct irq_data *data = irq_get_irq_data(gpio->irq); struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -327,7 +327,7 @@ static void xgpio_irq_ack(struct irq_data *irq_data)
{ {
} }
static int __maybe_unused xgpio_resume(struct device *dev) static int xgpio_resume(struct device *dev)
{ {
struct xgpio_instance *gpio = dev_get_drvdata(dev); struct xgpio_instance *gpio = dev_get_drvdata(dev);
struct irq_data *data = irq_get_irq_data(gpio->irq); struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -343,7 +343,7 @@ static int __maybe_unused xgpio_resume(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused xgpio_runtime_suspend(struct device *dev) static int xgpio_runtime_suspend(struct device *dev)
{ {
struct xgpio_instance *gpio = dev_get_drvdata(dev); struct xgpio_instance *gpio = dev_get_drvdata(dev);
@@ -352,7 +352,7 @@ static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused xgpio_runtime_resume(struct device *dev) static int xgpio_runtime_resume(struct device *dev)
{ {
struct xgpio_instance *gpio = dev_get_drvdata(dev); struct xgpio_instance *gpio = dev_get_drvdata(dev);
@@ -360,9 +360,8 @@ static int __maybe_unused xgpio_runtime_resume(struct device *dev)
} }
static const struct dev_pm_ops xgpio_dev_pm_ops = { static const struct dev_pm_ops xgpio_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume) SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume)
SET_RUNTIME_PM_OPS(xgpio_runtime_suspend, RUNTIME_PM_OPS(xgpio_runtime_suspend, xgpio_runtime_resume, NULL)
xgpio_runtime_resume, NULL)
}; };
/** /**
@@ -682,7 +681,7 @@ static struct platform_driver xgpio_plat_driver = {
.driver = { .driver = {
.name = "gpio-xilinx", .name = "gpio-xilinx",
.of_match_table = xgpio_of_match, .of_match_table = xgpio_of_match,
.pm = &xgpio_dev_pm_ops, .pm = pm_ptr(&xgpio_dev_pm_ops),
}, },
}; };