pinctrl: tegra: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 17 Jul 2023 17:28:21 +0000 (20:28 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 21 Aug 2023 16:07:44 +0000 (19:07 +0300)
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, make sure the PM ops are used only in CONFIG_PM_SLEEP=y
case by wrapping them in pm_sleep_ptr() macro.

Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20230717172821.62827-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/pinctrl/tegra/pinctrl-tegra.c
drivers/pinctrl/tegra/pinctrl-tegra210.c

index 4547cf6..734c71e 100644 (file)
@@ -747,10 +747,7 @@ static int tegra_pinctrl_resume(struct device *dev)
        return 0;
 }
 
-const struct dev_pm_ops tegra_pinctrl_pm = {
-       .suspend_noirq = &tegra_pinctrl_suspend,
-       .resume_noirq = &tegra_pinctrl_resume
-};
+DEFINE_NOIRQ_DEV_PM_OPS(tegra_pinctrl_pm, tegra_pinctrl_suspend, tegra_pinctrl_resume);
 
 static bool tegra_pinctrl_gpio_node_has_range(struct tegra_pmx *pmx)
 {
index 9bb2914..bc668b9 100644 (file)
@@ -1570,7 +1570,7 @@ static struct platform_driver tegra210_pinctrl_driver = {
        .driver = {
                .name = "tegra210-pinctrl",
                .of_match_table = tegra210_pinctrl_of_match,
-               .pm = &tegra_pinctrl_pm,
+               .pm = pm_sleep_ptr(&tegra_pinctrl_pm),
        },
        .probe = tegra210_pinctrl_probe,
 };