Skip to content

Commit dbedf93

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
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>
1 parent 353fdae commit dbedf93

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

drivers/gpio/gpio-xilinx.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static void xgpio_free(struct gpio_chip *chip, unsigned int offset)
286286
pm_runtime_put(chip->parent);
287287
}
288288

289-
static int __maybe_unused xgpio_suspend(struct device *dev)
289+
static int xgpio_suspend(struct device *dev)
290290
{
291291
struct xgpio_instance *gpio = dev_get_drvdata(dev);
292292
struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -327,7 +327,7 @@ static void xgpio_irq_ack(struct irq_data *irq_data)
327327
{
328328
}
329329

330-
static int __maybe_unused xgpio_resume(struct device *dev)
330+
static int xgpio_resume(struct device *dev)
331331
{
332332
struct xgpio_instance *gpio = dev_get_drvdata(dev);
333333
struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -343,7 +343,7 @@ static int __maybe_unused xgpio_resume(struct device *dev)
343343
return 0;
344344
}
345345

346-
static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
346+
static int xgpio_runtime_suspend(struct device *dev)
347347
{
348348
struct xgpio_instance *gpio = dev_get_drvdata(dev);
349349

@@ -352,17 +352,16 @@ static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
352352
return 0;
353353
}
354354

355-
static int __maybe_unused xgpio_runtime_resume(struct device *dev)
355+
static int xgpio_runtime_resume(struct device *dev)
356356
{
357357
struct xgpio_instance *gpio = dev_get_drvdata(dev);
358358

359359
return clk_enable(gpio->clk);
360360
}
361361

362362
static const struct dev_pm_ops xgpio_dev_pm_ops = {
363-
SET_SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume)
364-
SET_RUNTIME_PM_OPS(xgpio_runtime_suspend,
365-
xgpio_runtime_resume, NULL)
363+
SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume)
364+
RUNTIME_PM_OPS(xgpio_runtime_suspend, xgpio_runtime_resume, NULL)
366365
};
367366

368367
/**
@@ -682,7 +681,7 @@ static struct platform_driver xgpio_plat_driver = {
682681
.driver = {
683682
.name = "gpio-xilinx",
684683
.of_match_table = xgpio_of_match,
685-
.pm = &xgpio_dev_pm_ops,
684+
.pm = pm_ptr(&xgpio_dev_pm_ops),
686685
},
687686
};
688687

0 commit comments

Comments
 (0)