From: Mark Brown Date: Fri, 30 Sep 2016 16:13:58 +0000 (-0700) Subject: Merge remote-tracking branches 'regulator/topic/of', 'regulator/topic/pv88080', ... X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=2dfcb921da781f8b1a166d0ff3a36b3e6804cdf1;p=openwrt%2Fstaging%2Fblogic.git Merge remote-tracking branches 'regulator/topic/of', 'regulator/topic/pv88080', 'regulator/topic/rk808', 'regulator/topic/set-voltage' and 'regulator/topic/tps65218' into regulator-next --- 2dfcb921da781f8b1a166d0ff3a36b3e6804cdf1 diff --cc drivers/regulator/core.c index c5445ead3203,db320e8fa865,db320e8fa865,db320e8fa865,c52fc0ce2693,db320e8fa865..67426c0477d3 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@@@@@@ -2800,28 -2800,28 -2800,28 -2800,28 -2819,43 -2800,28 +2819,43 @@@@@@@ static int _regulator_do_set_voltage(st ret = -EINVAL; } ---- - /* Call set_voltage_time_sel if successfully obtained old_selector */ ---- - if (ret == 0 && !rdev->constraints->ramp_disable && old_selector >= 0 ---- - && old_selector != selector) { ++++ + if (ret) ++++ + goto out; ---- - delay = rdev->desc->ops->set_voltage_time_sel(rdev, ---- - old_selector, selector); ---- - if (delay < 0) { ---- - rdev_warn(rdev, "set_voltage_time_sel() failed: %d\n", ---- - delay); ---- - delay = 0; ++++ + if (ops->set_voltage_time_sel) { ++++ + /* ++++ + * Call set_voltage_time_sel if successfully obtained ++++ + * old_selector ++++ + */ ++++ + if (old_selector >= 0 && old_selector != selector) ++++ + delay = ops->set_voltage_time_sel(rdev, old_selector, ++++ + selector); ++++ + } else { ++++ + if (old_uV != best_val) { ++++ + if (ops->set_voltage_time) ++++ + delay = ops->set_voltage_time(rdev, old_uV, ++++ + best_val); ++++ + else ++++ + delay = _regulator_set_voltage_time(rdev, ++++ + old_uV, ++++ + best_val); } ++++ + } ---- - /* Insert any necessary delays */ ---- - if (delay >= 1000) { ---- - mdelay(delay / 1000); ---- - udelay(delay % 1000); ---- - } else if (delay) { ---- - udelay(delay); ---- - } ++++ + if (delay < 0) { ++++ + rdev_warn(rdev, "failed to get delay: %d\n", delay); ++++ + delay = 0; + } + --- - if (ret == 0 && best_val >= 0) { ++++ + /* Insert any necessary delays */ ++++ + if (delay >= 1000) { ++++ + mdelay(delay / 1000); ++++ + udelay(delay % 1000); ++++ + } else if (delay) { ++++ + udelay(delay); +++ + } +++ + - if (ret == 0 && best_val >= 0) { ++++ + if (best_val >= 0) { unsigned long data = best_val; _notifier_call_chain(rdev, REGULATOR_EVENT_VOLTAGE_CHANGE,