From 8fe5f5efe5a3e38eed97f8126d4a9eb9f7e32685 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sat, 14 May 2011 11:19:45 -0700 Subject: [PATCH] --- yaml --- r: 252170 b: refs/heads/master c: a4b4148379ef1ad460fc1aa6bcf2cde99cd91166 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/regulator/core.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index cdc6dcfcfa56..53a38cb1af6b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: afdaaafe8e829364d9c1276b5435cc28ee5619df +refs/heads/master: a4b4148379ef1ad460fc1aa6bcf2cde99cd91166 diff --git a/trunk/drivers/regulator/core.c b/trunk/drivers/regulator/core.c index 58452ac0f165..7287000595e5 100644 --- a/trunk/drivers/regulator/core.c +++ b/trunk/drivers/regulator/core.c @@ -2097,16 +2097,26 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load) mutex_lock(&rdev->mutex); + /* + * first check to see if we can set modes at all, otherwise just + * tell the consumer everything is OK. + */ regulator->uA_load = uA_load; ret = regulator_check_drms(rdev); - if (ret < 0) + if (ret < 0) { + ret = 0; goto out; - ret = -EINVAL; + } - /* sanity check */ if (!rdev->desc->ops->get_optimum_mode) goto out; + /* + * we can actually do this so any errors are indicators of + * potential real failure. + */ + ret = -EINVAL; + /* get output voltage */ output_uV = _regulator_get_voltage(rdev); if (output_uV <= 0) {