Re: [PATCH] regulator: core: Fast path non-deferred disables

2012-09-07 Thread Liam Girdwood
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 

Acked-by: Liam Girdwood 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] regulator: core: Fast path non-deferred disables

2012-09-06 Thread 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 
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/