Skip to content

Commit 83f7586

Browse files
committed
pinctrl: tegra: 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, 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>
1 parent 727eb02 commit 83f7586

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

drivers/pinctrl/tegra/pinctrl-tegra.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,7 @@ static int tegra_pinctrl_resume(struct device *dev)
747747
return 0;
748748
}
749749

750-
const struct dev_pm_ops tegra_pinctrl_pm = {
751-
.suspend_noirq = &tegra_pinctrl_suspend,
752-
.resume_noirq = &tegra_pinctrl_resume
753-
};
750+
DEFINE_NOIRQ_DEV_PM_OPS(tegra_pinctrl_pm, tegra_pinctrl_suspend, tegra_pinctrl_resume);
754751

755752
static bool tegra_pinctrl_gpio_node_has_range(struct tegra_pmx *pmx)
756753
{

drivers/pinctrl/tegra/pinctrl-tegra210.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ static struct platform_driver tegra210_pinctrl_driver = {
15701570
.driver = {
15711571
.name = "tegra210-pinctrl",
15721572
.of_match_table = tegra210_pinctrl_of_match,
1573-
.pm = &tegra_pinctrl_pm,
1573+
.pm = pm_sleep_ptr(&tegra_pinctrl_pm),
15741574
},
15751575
.probe = tegra210_pinctrl_probe,
15761576
};

0 commit comments

Comments
 (0)