Skip to content

Commit f0d8d0e

Browse files
committed
pinctrl: at91: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper
Since pm.h provides a helper for system no-IRQ PM callbacks, switch the driver to use it instead of open coded variant. With that switch pm_ptr() to pm_sleep_ptr() as the above mentioned callbacks are only used for system sleep. The use of the pm_sleep_ptr() macro allows the compiler to always see the dev_pm_ops structure and related functions, while still allowing the unused code to be removed, without the need for the __maybe_unused markings. Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230717172821.62827-7-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent e5f32bf commit f0d8d0e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/pinctrl/pinctrl-at91.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ static int gpio_irq_set_wake(struct irq_data *d, unsigned state)
16571657
return 0;
16581658
}
16591659

1660-
static int __maybe_unused at91_gpio_suspend(struct device *dev)
1660+
static int at91_gpio_suspend(struct device *dev)
16611661
{
16621662
struct at91_gpio_chip *at91_chip = dev_get_drvdata(dev);
16631663
void __iomem *pio = at91_chip->regbase;
@@ -1675,7 +1675,7 @@ static int __maybe_unused at91_gpio_suspend(struct device *dev)
16751675
return 0;
16761676
}
16771677

1678-
static int __maybe_unused at91_gpio_resume(struct device *dev)
1678+
static int at91_gpio_resume(struct device *dev)
16791679
{
16801680
struct at91_gpio_chip *at91_chip = dev_get_drvdata(dev);
16811681
void __iomem *pio = at91_chip->regbase;
@@ -1903,15 +1903,13 @@ static int at91_gpio_probe(struct platform_device *pdev)
19031903
return 0;
19041904
}
19051905

1906-
static const struct dev_pm_ops at91_gpio_pm_ops = {
1907-
NOIRQ_SYSTEM_SLEEP_PM_OPS(at91_gpio_suspend, at91_gpio_resume)
1908-
};
1906+
static DEFINE_NOIRQ_DEV_PM_OPS(at91_gpio_pm_ops, at91_gpio_suspend, at91_gpio_resume);
19091907

19101908
static struct platform_driver at91_gpio_driver = {
19111909
.driver = {
19121910
.name = "gpio-at91",
19131911
.of_match_table = at91_gpio_of_match,
1914-
.pm = pm_ptr(&at91_gpio_pm_ops),
1912+
.pm = pm_sleep_ptr(&at91_gpio_pm_ops),
19151913
},
19161914
.probe = at91_gpio_probe,
19171915
};

0 commit comments

Comments
 (0)