diff options
author | Thierry Reding <thierry.reding@gmail.com> | 2020-01-20 15:22:37 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2020-01-20 15:22:37 +0100 |
commit | 413c2a110d649a3a313ee91920e3d9373b9f2045 (patch) | |
tree | cff208dac5ef80c76eaab0d0ee791df1ef2c59a8 /drivers/pwm/pwm-sun4i.c | |
parent | 0c73201c5c094256236b129799ab6761b491d8cd (diff) | |
download | linux-413c2a110d649a3a313ee91920e3d9373b9f2045.tar.bz2 |
pwm: sun4i: Initialize variables before use
GCC can't always determine that the duty, period and prescaler values
are initialized when returning from sun4i_pwm_calculate(), so help out a
little by initializing them to 0.
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-sun4i.c')
-rw-r--r-- | drivers/pwm/pwm-sun4i.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c index 0decc7cde133..3e3efa6c768f 100644 --- a/drivers/pwm/pwm-sun4i.c +++ b/drivers/pwm/pwm-sun4i.c @@ -234,9 +234,9 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, { struct sun4i_pwm_chip *sun4i_pwm = to_sun4i_pwm_chip(chip); struct pwm_state cstate; - u32 ctrl, duty, period, val; + u32 ctrl, duty = 0, period = 0, val; int ret; - unsigned int delay_us, prescaler; + unsigned int delay_us, prescaler = 0; unsigned long now; bool bypass; |