diff mbox series

[v3,3/6] pwm: rockchip: Don't update the state for the caller of pwm_apply_state()

Message ID 20190824153707.13746-4-uwe@kleine-koenig.org (mailing list archive)
State New, archived
Headers show
Series pwm: ensure pwm_apply_state() doesn't modify the state argument | expand

Commit Message

Uwe Kleine-König Aug. 24, 2019, 3:37 p.m. UTC
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

The pwm-rockchip driver is one of only three PWM drivers which updates
the state for the caller of pwm_apply_state(). This might have
surprising results if the caller reuses the values expecting them to
still represent the same state.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-rockchip.c | 6 ------
 1 file changed, 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
index 51b96cb7dd25..cc502c8d7e9c 100644
--- a/drivers/pwm/pwm-rockchip.c
+++ b/drivers/pwm/pwm-rockchip.c
@@ -212,12 +212,6 @@  static int rockchip_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 			goto out;
 	}
 
-	/*
-	 * Update the state with the real hardware, which can differ a bit
-	 * because of period/duty_cycle approximation.
-	 */
-	rockchip_pwm_get_state(chip, pwm, state);
-
 out:
 	clk_disable(pc->pclk);