Skip to content

Commit 75ff162

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
gpio: tqmx86: 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> Link: https://lore.kernel.org/r/20251124002105.25429-11-jszhang@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 0ed358a commit 75ff162

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/gpio/gpio-tqmx86.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,19 +279,18 @@ static void tqmx86_gpio_irq_handler(struct irq_desc *desc)
279279
}
280280

281281
/* Minimal runtime PM is needed by the IRQ subsystem */
282-
static int __maybe_unused tqmx86_gpio_runtime_suspend(struct device *dev)
282+
static int tqmx86_gpio_runtime_suspend(struct device *dev)
283283
{
284284
return 0;
285285
}
286286

287-
static int __maybe_unused tqmx86_gpio_runtime_resume(struct device *dev)
287+
static int tqmx86_gpio_runtime_resume(struct device *dev)
288288
{
289289
return 0;
290290
}
291291

292292
static const struct dev_pm_ops tqmx86_gpio_dev_pm_ops = {
293-
SET_RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend,
294-
tqmx86_gpio_runtime_resume, NULL)
293+
RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend, tqmx86_gpio_runtime_resume, NULL)
295294
};
296295

297296
static void tqmx86_init_irq_valid_mask(struct gpio_chip *chip,
@@ -425,7 +424,7 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
425424
static struct platform_driver tqmx86_gpio_driver = {
426425
.driver = {
427426
.name = "tqmx86-gpio",
428-
.pm = &tqmx86_gpio_dev_pm_ops,
427+
.pm = pm_ptr(&tqmx86_gpio_dev_pm_ops),
429428
},
430429
.probe = tqmx86_gpio_probe,
431430
};

0 commit comments

Comments
 (0)