diff mbox series

[1/2] pwm: rcar: Drop useless call to pwm_get_state

Message ID 20191024071410.30620-1-u.kleine-koenig@pengutronix.de
State Accepted
Headers show
Series [1/2] pwm: rcar: Drop useless call to pwm_get_state | expand

Commit Message

Uwe Kleine-König Oct. 24, 2019, 7:14 a.m. UTC
pwm_get_state has no side effects and the resulting pwm_state is unused.
So drop the call to pwm_get_state and the local variable from
rcar_pwm_apply().

The call was introduced in commit 7f68ce8287d3 ("pwm: rcar: Add support
"atomic" API") and already then was useless.

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

Comments

Yoshihiro Shimoda Oct. 24, 2019, 7:20 a.m. UTC | #1
Hi Uwe,

> From: Uwe Kleine-Konig, Sent: Thursday, October 24, 2019 4:14 PM
> 
> pwm_get_state has no side effects and the resulting pwm_state is unused.
> So drop the call to pwm_get_state and the local variable from
> rcar_pwm_apply().
> 
> The call was introduced in commit 7f68ce8287d3 ("pwm: rcar: Add support
> "atomic" API") and already then was useless.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c
index 852eb2347954..6fac8eb98d54 100644
--- a/drivers/pwm/pwm-rcar.c
+++ b/drivers/pwm/pwm-rcar.c
@@ -161,11 +161,9 @@  static int rcar_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 			  const struct pwm_state *state)
 {
 	struct rcar_pwm_chip *rp = to_rcar_pwm_chip(chip);
-	struct pwm_state cur_state;
 	int div, ret;
 
 	/* This HW/driver only supports normal polarity */
-	pwm_get_state(pwm, &cur_state);
 	if (state->polarity != PWM_POLARITY_NORMAL)
 		return -ENOTSUPP;