aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-sprd.c
diff options
context:
space:
mode:
authorThierry Reding <[email protected]>2023-03-23 13:49:21 +0000
committerThierry Reding <[email protected]>2023-03-23 13:49:21 +0000
commit320bb07581ad6f889f30a6fcbed8e6f62d378e8f (patch)
treef5dddb574ebd830743af205b0ba19b913c742596 /drivers/pwm/pwm-sprd.c
parentLinux 6.3-rc1 (diff)
parentpwm: Zero-initialize the pwm_state passed to driver's .get_state() (diff)
downloadkernel-320bb07581ad6f889f30a6fcbed8e6f62d378e8f.tar.gz
kernel-320bb07581ad6f889f30a6fcbed8e6f62d378e8f.zip
Merge branch 'fixes' into for-next
Diffstat (limited to 'drivers/pwm/pwm-sprd.c')
-rw-r--r--drivers/pwm/pwm-sprd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c
index d866ce345f97..bde579a338c2 100644
--- a/drivers/pwm/pwm-sprd.c
+++ b/drivers/pwm/pwm-sprd.c
@@ -109,6 +109,7 @@ static int sprd_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
duty = val & SPRD_PWM_DUTY_MSK;
tmp = (prescale + 1) * NSEC_PER_SEC * duty;
state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, chn->clk_rate);
+ state->polarity = PWM_POLARITY_NORMAL;
/* Disable PWM clocks if the PWM channel is not in enable state. */
if (!state->enabled)