Message ID | 20230717172821.62827-11-andriy.shevchenko@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | pinctrl: Provide NOIRQ PM helper and use it | expand |
Hi Andy, Le lundi 17 juillet 2023 à 20:28 +0300, Andy Shevchenko a écrit : > Since pm.h provides a helper for system no-IRQ PM callbacks, > switch the driver to use it instead of open coded variant. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/pinctrl/tegra/pinctrl-tegra.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c > b/drivers/pinctrl/tegra/pinctrl-tegra.c > index 4547cf66d03b..734c71ef005b 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c > @@ -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) > { Another driver where using EXPORT_GPL_DEV_PM_OPS() would make more sense. Cheers, -Paul
On Mon, 17 Jul 2023 20:28:21 +0300 Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > Since pm.h provides a helper for system no-IRQ PM callbacks, > switch the driver to use it instead of open coded variant. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> No pm_sleep_ptr()? > --- > drivers/pinctrl/tegra/pinctrl-tegra.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c > index 4547cf66d03b..734c71ef005b 100644 > --- a/drivers/pinctrl/tegra/pinctrl-tegra.c > +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c > @@ -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) > {
On Tue, Jul 18, 2023 at 11:11:43AM +0100, Jonathan Cameron wrote: > On Mon, 17 Jul 2023 20:28:21 +0300 > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > > Since pm.h provides a helper for system no-IRQ PM callbacks, > > switch the driver to use it instead of open coded variant. > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > No pm_sleep_ptr()? pm_sleep_ptr() is pointless on this driver. This driver is selected by ARCH_TEGRA and ARCH_TEGRA also always selects PM. Thierry
Hi Thierry, Le mardi 18 juillet 2023 à 13:38 +0200, Thierry Reding a écrit : > On Tue, Jul 18, 2023 at 11:11:43AM +0100, Jonathan Cameron wrote: > > On Mon, 17 Jul 2023 20:28:21 +0300 > > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > > > > Since pm.h provides a helper for system no-IRQ PM callbacks, > > > switch the driver to use it instead of open coded variant. > > > > > > Signed-off-by: Andy Shevchenko > > > <andriy.shevchenko@linux.intel.com> > > > > No pm_sleep_ptr()? > > pm_sleep_ptr() is pointless on this driver. This driver is selected > by > ARCH_TEGRA and ARCH_TEGRA also always selects PM. If I'm not mistaken, ARCH_TEGRA selects CONFIG_PM, not CONFIG_PM_SLEEP. Cheers, -Paul
On Tue, Jul 18, 2023 at 02:01:27PM +0200, Paul Cercueil wrote: > Hi Thierry, > > Le mardi 18 juillet 2023 à 13:38 +0200, Thierry Reding a écrit : > > On Tue, Jul 18, 2023 at 11:11:43AM +0100, Jonathan Cameron wrote: > > > On Mon, 17 Jul 2023 20:28:21 +0300 > > > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > > > > > > Since pm.h provides a helper for system no-IRQ PM callbacks, > > > > switch the driver to use it instead of open coded variant. > > > > > > > > Signed-off-by: Andy Shevchenko > > > > <andriy.shevchenko@linux.intel.com> > > > > > > No pm_sleep_ptr()? > > > > pm_sleep_ptr() is pointless on this driver. This driver is selected > > by > > ARCH_TEGRA and ARCH_TEGRA also always selects PM. > > If I'm not mistaken, ARCH_TEGRA selects CONFIG_PM, not CONFIG_PM_SLEEP. Indeed. I suppose pm_sleep_ptr() would make sense, then. Thierry
diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c index 4547cf66d03b..734c71ef005b 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c @@ -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) {
Since pm.h provides a helper for system no-IRQ PM callbacks, switch the driver to use it instead of open coded variant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/pinctrl/tegra/pinctrl-tegra.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)