[PATCH v3 2/2] gpio: tegra: Switch to new *_PM_OPS macros

From: Svyatoslav Ryhel
Date: Tue Oct 18 2022 - 04:50:12 EST


Since SET_*_PM_OPS() were deprecated, switch to new *_PM_OPS.

The callbacks that are only useful with CONFIG_PM_SLEEP is enabled,
are now wrapped with a pm_sleep_ptr().

Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
---
drivers/gpio/gpio-tegra.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 5b265a6fd3c1..ce17cc1a1cab 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -461,7 +461,6 @@ static int tegra_gpio_populate_parent_fwspec(struct gpio_chip *chip,
return 0;
}

-#ifdef CONFIG_PM_SLEEP
static int tegra_gpio_resume(struct device *dev)
{
struct tegra_gpio_info *tgi = dev_get_drvdata(dev);
@@ -569,7 +568,6 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)

return 0;
}
-#endif

static int tegra_gpio_irq_set_affinity(struct irq_data *data,
const struct cpumask *dest,
@@ -613,9 +611,7 @@ static const struct irq_chip tegra_gpio_irq_chip = {
.irq_mask = tegra_gpio_irq_mask,
.irq_unmask = tegra_gpio_irq_unmask,
.irq_set_type = tegra_gpio_irq_set_type,
-#ifdef CONFIG_PM_SLEEP
- .irq_set_wake = tegra_gpio_irq_set_wake,
-#endif
+ .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake),
.irq_print_chip = tegra_gpio_irq_print_chip,
.irq_request_resources = tegra_gpio_irq_request_resources,
.irq_release_resources = tegra_gpio_irq_release_resources,
@@ -629,9 +625,7 @@ static const struct irq_chip tegra210_gpio_irq_chip = {
.irq_unmask = tegra_gpio_irq_unmask,
.irq_set_affinity = tegra_gpio_irq_set_affinity,
.irq_set_type = tegra_gpio_irq_set_type,
-#ifdef CONFIG_PM_SLEEP
- .irq_set_wake = tegra_gpio_irq_set_wake,
-#endif
+ .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake),
.irq_print_chip = tegra_gpio_irq_print_chip,
.irq_request_resources = tegra_gpio_irq_request_resources,
.irq_release_resources = tegra_gpio_irq_release_resources,
@@ -681,7 +675,7 @@ static inline void tegra_gpio_debuginit(struct tegra_gpio_info *tgi)
#endif

static const struct dev_pm_ops tegra_gpio_pm_ops = {
- SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume)
+ NOIRQ_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume)
};

static const struct of_device_id tegra_pmc_of_match[] = {
--
2.34.1