summaryrefslogtreecommitdiff
path: root/drivers/power/regulator
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@openbsd.org>2017-05-13 18:17:05 (GMT)
committerSimon Glass <sjg@chromium.org>2017-06-07 13:29:19 (GMT)
commitc40d48bbbce70b8dfa2b267e404f9f3e781dfd98 (patch)
tree15726b12eb94dbb375d75638f6e6a3411e0455a7 /drivers/power/regulator
parentd1bf69d822724d427b23e289b0c2cf9275c1e99e (diff)
downloadu-boot-fsl-qoriq-c40d48bbbce70b8dfa2b267e404f9f3e781dfd98.tar.xz
regulator: pwm: Fix handling of missing init voltage
Since priv->init_voltage is an unsigned integer it can never be negative. So the current code fails to detect a missing 'regulator-init-microvolt' property and instead misconfigures the PWM device. Fix this by making the relevant members of 'struct pwm_regulator_info' signed integers. Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Diffstat (limited to 'drivers/power/regulator')
-rw-r--r--drivers/power/regulator/pwm_regulator.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/power/regulator/pwm_regulator.c b/drivers/power/regulator/pwm_regulator.c
index a6c9fcc..00a7cca 100644
--- a/drivers/power/regulator/pwm_regulator.c
+++ b/drivers/power/regulator/pwm_regulator.c
@@ -32,13 +32,13 @@ struct pwm_regulator_info {
bool polarity;
struct udevice *pwm;
/* initialize voltage of regulator */
- unsigned int init_voltage;
+ int init_voltage;
/* the maximum voltage of regulator */
- unsigned int max_voltage;
+ int max_voltage;
/* the minimum voltage of regulator */
- unsigned int min_voltage;
+ int min_voltage;
/* the current voltage of regulator */
- unsigned int volt_uV;
+ int volt_uV;
};
static int pwm_regulator_enable(struct udevice *dev, bool enable)