linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Fast path non-deferred disables
@ 2012-09-07  3:01 Mark Brown
  2012-09-07 15:03 ` Liam Girdwood
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2012-09-07  3:01 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

Users (especially framework code) may end up passing in a zero deferral
time depending on runtime conditions or configuration. If they do then
just call regulator_disable() directly to save scheduling.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/core.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index e6bb1f9..3ddc837 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1749,6 +1749,9 @@ int regulator_disable_deferred(struct regulator *regulator, int ms)
 	if (regulator->always_on)
 		return 0;
 
+	if (!ms)
+		return regulator_disable(regulator);
+
 	mutex_lock(&rdev->mutex);
 	rdev->deferred_disables++;
 	mutex_unlock(&rdev->mutex);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: core: Fast path non-deferred disables
  2012-09-07  3:01 [PATCH] regulator: core: Fast path non-deferred disables Mark Brown
@ 2012-09-07 15:03 ` Liam Girdwood
  0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2012-09-07 15:03 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

On Fri, 2012-09-07 at 11:01 +0800, Mark Brown wrote:
> Users (especially framework code) may end up passing in a zero deferral
> time depending on runtime conditions or configuration. If they do then
> just call regulator_disable() directly to save scheduling.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Acked-by: Liam Girdwood <lrg@ti.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-07 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-07  3:01 [PATCH] regulator: core: Fast path non-deferred disables Mark Brown
2012-09-07 15:03 ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).