Commit ba73deb1 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding
Browse files

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: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 9e3ca01f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -90,10 +90,10 @@ static void rockchip_pwm_get_state(struct pwm_chip *chip,
		state->enabled = ((val & enable_conf) == enable_conf) ?
				 true : false;

	if (pc->data->supports_polarity) {
		if (!(val & PWM_DUTY_POSITIVE))
	if (pc->data->supports_polarity && !(val & PWM_DUTY_POSITIVE))
		state->polarity = PWM_POLARITY_INVERSED;
	}
	else
		state->polarity = PWM_POLARITY_NORMAL;

	clk_disable(pc->pclk);
}