diff mbox series

[v3] pwm: rcar: remove a redundant condition in rcar_pwm_apply()

Message ID 1566195612-11614-1-git-send-email-yoshihiro.shimoda.uh@renesas.com
State Accepted
Headers show
Series [v3] pwm: rcar: remove a redundant condition in rcar_pwm_apply() | expand

Commit Message

Yoshihiro Shimoda Aug. 19, 2019, 6:20 a.m. UTC
Since the rcar_pwm_apply() has already checked whether state->enabled
is set or not, this patch removes a redundant condition.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Changes from v2:
 - Revise some typos in the commit log.
https://patchwork.kernel.org/patch/11083353/

Changes from v1:
 - Spin-off this independent patch (5/7).
 - Add Geert and Uwe's Reviewed-by.
https://patchwork.kernel.org/patch/11034743/

 drivers/pwm/pwm-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Aug. 19, 2019, 9:44 a.m. UTC | #1
On Mon, Aug 19, 2019 at 03:20:12PM +0900, Yoshihiro Shimoda wrote:
> Since the rcar_pwm_apply() has already checked whether state->enabled
> is set or not, this patch removes a redundant condition.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> Changes from v2:
>  - Revise some typos in the commit log.
> https://patchwork.kernel.org/patch/11083353/
> 
> Changes from v1:
>  - Spin-off this independent patch (5/7).
>  - Add Geert and Uwe's Reviewed-by.
> https://patchwork.kernel.org/patch/11034743/
> 
>  drivers/pwm/pwm-rcar.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c
> index 5b2b8ec..c8cd43f 100644
> --- a/drivers/pwm/pwm-rcar.c
> +++ b/drivers/pwm/pwm-rcar.c
> @@ -187,7 +187,7 @@ static int rcar_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
>  	/* The SYNC should be set to 0 even if rcar_pwm_set_counter failed */
>  	rcar_pwm_update(rp, RCAR_PWMCR_SYNC, 0, RCAR_PWMCR);
>  
> -	if (!ret && state->enabled)
> +	if (!ret)
>  		ret = rcar_pwm_enable(rp);
>  
>  	return ret;
> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c
index 5b2b8ec..c8cd43f 100644
--- a/drivers/pwm/pwm-rcar.c
+++ b/drivers/pwm/pwm-rcar.c
@@ -187,7 +187,7 @@  static int rcar_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 	/* The SYNC should be set to 0 even if rcar_pwm_set_counter failed */
 	rcar_pwm_update(rp, RCAR_PWMCR_SYNC, 0, RCAR_PWMCR);
 
-	if (!ret && state->enabled)
+	if (!ret)
 		ret = rcar_pwm_enable(rp);
 
 	return ret;