linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: Set delay to 0 if set_voltage_time_sel callback returns error
@ 2012-02-24  7:17 Axel Lin
  2012-02-24 14:51 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-02-24  7:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown

rdev->desc->ops->set_voltage_time_sel may return negative error code.
Set delay to 0 if we got error.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index beeeb7f..61448b6 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1892,6 +1892,8 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
 			old_selector = ret;
 			delay = rdev->desc->ops->set_voltage_time_sel(rdev,
 						old_selector, selector);
+			if (delay < 0)
+				delay = 0;
 		}
 
 		if (best_val != INT_MAX) {
-- 
1.7.5.4




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

end of thread, other threads:[~2012-02-24 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-24  7:17 [PATCH] regulator: Set delay to 0 if set_voltage_time_sel callback returns error Axel Lin
2012-02-24 14:51 ` Mark Brown

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).