提交 ba73deb1 编写于 作者: U Uwe Kleine-König 提交者: Thierry Reding

pwm: rockchip: Set polarity unconditionally in .get_state()

Don't rely on *state being zero initialized and PWM_POLARITY_NORMAL
being zero. So always assign .polarity.
Signed-off-by: NUwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 9e3ca01f
...@@ -90,10 +90,10 @@ static void rockchip_pwm_get_state(struct pwm_chip *chip, ...@@ -90,10 +90,10 @@ static void rockchip_pwm_get_state(struct pwm_chip *chip,
state->enabled = ((val & enable_conf) == enable_conf) ? state->enabled = ((val & enable_conf) == enable_conf) ?
true : false; true : false;
if (pc->data->supports_polarity) { if (pc->data->supports_polarity && !(val & PWM_DUTY_POSITIVE))
if (!(val & PWM_DUTY_POSITIVE)) state->polarity = PWM_POLARITY_INVERSED;
state->polarity = PWM_POLARITY_INVERSED; else
} state->polarity = PWM_POLARITY_NORMAL;
clk_disable(pc->pclk); clk_disable(pc->pclk);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册