* [PATCH] PM: lenient generic runtime pm callbacks
@ 2010-09-06 22:20 Ohad Ben-Cohen
2010-09-07 22:56 ` Kevin Hilman
2010-09-08 10:55 ` Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Ohad Ben-Cohen @ 2010-09-06 22:20 UTC (permalink / raw)
To: linux-pm; +Cc: Mark Brown
Allow drivers, that belong to subsystems which use the generic
runtime pm callbacks, not to define runtime pm suspend/resume handlers,
by implicitly assuming success in such cases.
This is needed to eliminate nop handlers that would otherwise be
necessary by drivers which enable runtime pm, but don't need
to do anything when their devices are runtime-suspended/resumed.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/base/power/generic_ops.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
index 4b29d49..81f2c84 100644
--- a/drivers/base/power/generic_ops.c
+++ b/drivers/base/power/generic_ops.c
@@ -46,7 +46,7 @@ int pm_generic_runtime_suspend(struct device *dev)
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
int ret;
- ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : -EINVAL;
+ ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : 0;
return ret;
}
@@ -65,7 +65,7 @@ int pm_generic_runtime_resume(struct device *dev)
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
int ret;
- ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : -EINVAL;
+ ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : 0;
return ret;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] PM: lenient generic runtime pm callbacks
2010-09-06 22:20 [PATCH] PM: lenient generic runtime pm callbacks Ohad Ben-Cohen
@ 2010-09-07 22:56 ` Kevin Hilman
2010-09-08 10:55 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Kevin Hilman @ 2010-09-07 22:56 UTC (permalink / raw)
To: Ohad Ben-Cohen; +Cc: linux-pm, Mark Brown
Ohad Ben-Cohen <ohad@wizery.com> writes:
> Allow drivers, that belong to subsystems which use the generic
> runtime pm callbacks, not to define runtime pm suspend/resume handlers,
> by implicitly assuming success in such cases.
>
> This is needed to eliminate nop handlers that would otherwise be
> necessary by drivers which enable runtime pm, but don't need
> to do anything when their devices are runtime-suspended/resumed.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
for runtime PM of on-chip devices on OMAP, this will cleanup several nop
handlers we have had to put in place.
FWIW, the 'no_callbacks' approach won't work for runtime PM of on-chip
devices for us since most of the devices will have callbacks, only some
will not need them.
Kevin
> ---
> drivers/base/power/generic_ops.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
> index 4b29d49..81f2c84 100644
> --- a/drivers/base/power/generic_ops.c
> +++ b/drivers/base/power/generic_ops.c
> @@ -46,7 +46,7 @@ int pm_generic_runtime_suspend(struct device *dev)
> const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> int ret;
>
> - ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : -EINVAL;
> + ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : 0;
>
> return ret;
> }
> @@ -65,7 +65,7 @@ int pm_generic_runtime_resume(struct device *dev)
> const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> int ret;
>
> - ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : -EINVAL;
> + ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : 0;
>
> return ret;
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PM: lenient generic runtime pm callbacks
2010-09-06 22:20 [PATCH] PM: lenient generic runtime pm callbacks Ohad Ben-Cohen
2010-09-07 22:56 ` Kevin Hilman
@ 2010-09-08 10:55 ` Mark Brown
2010-09-08 23:46 ` Rafael J. Wysocki
1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2010-09-08 10:55 UTC (permalink / raw)
To: Ohad Ben-Cohen; +Cc: linux-pm
On Tue, Sep 07, 2010 at 01:20:42AM +0300, Ohad Ben-Cohen wrote:
> Allow drivers, that belong to subsystems which use the generic
> runtime pm callbacks, not to define runtime pm suspend/resume handlers,
> by implicitly assuming success in such cases.
>
> This is needed to eliminate nop handlers that would otherwise be
> necessary by drivers which enable runtime pm, but don't need
> to do anything when their devices are runtime-suspended/resumed.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
As I said previously this would also remove some dummy suspend functions
I need for some MFDs.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PM: lenient generic runtime pm callbacks
2010-09-08 10:55 ` Mark Brown
@ 2010-09-08 23:46 ` Rafael J. Wysocki
0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2010-09-08 23:46 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-pm
On Wednesday, September 08, 2010, Mark Brown wrote:
> On Tue, Sep 07, 2010 at 01:20:42AM +0300, Ohad Ben-Cohen wrote:
> > Allow drivers, that belong to subsystems which use the generic
> > runtime pm callbacks, not to define runtime pm suspend/resume handlers,
> > by implicitly assuming success in such cases.
> >
> > This is needed to eliminate nop handlers that would otherwise be
> > necessary by drivers which enable runtime pm, but don't need
> > to do anything when their devices are runtime-suspended/resumed.
> >
> > Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> As I said previously this would also remove some dummy suspend functions
> I need for some MFDs.
Applied to suspend-2.6/linux-next.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-08 23:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 22:20 [PATCH] PM: lenient generic runtime pm callbacks Ohad Ben-Cohen
2010-09-07 22:56 ` Kevin Hilman
2010-09-08 10:55 ` Mark Brown
2010-09-08 23:46 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox