mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-30 10:49:53 +00:00
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>
This commit is contained in:
parent
d1bf69d822
commit
c40d48bbbc
1 changed files with 4 additions and 4 deletions
|
@ -32,13 +32,13 @@ struct pwm_regulator_info {
|
||||||
bool polarity;
|
bool polarity;
|
||||||
struct udevice *pwm;
|
struct udevice *pwm;
|
||||||
/* initialize voltage of regulator */
|
/* initialize voltage of regulator */
|
||||||
unsigned int init_voltage;
|
int init_voltage;
|
||||||
/* the maximum voltage of regulator */
|
/* the maximum voltage of regulator */
|
||||||
unsigned int max_voltage;
|
int max_voltage;
|
||||||
/* the minimum voltage of regulator */
|
/* the minimum voltage of regulator */
|
||||||
unsigned int min_voltage;
|
int min_voltage;
|
||||||
/* the current voltage of regulator */
|
/* the current voltage of regulator */
|
||||||
unsigned int volt_uV;
|
int volt_uV;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int pwm_regulator_enable(struct udevice *dev, bool enable)
|
static int pwm_regulator_enable(struct udevice *dev, bool enable)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue