[v2] pwm: rcar: remove a redundant condition in rcar_pwm_apply()
diff mbox series

Message ID 1565246333-2185-1-git-send-email-yoshihiro.shimoda.uh@renesas.com
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series
  • [v2] pwm: rcar: remove a redundant condition in rcar_pwm_apply()
Related show

Commit Message

Yoshihiro Shimoda Aug. 8, 2019, 6:38 a.m. UTC
Since the rcar_pwm_apply() has already check whehter state->enabled
is not 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 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

Sergei Shtylyov Aug. 8, 2019, 9:55 a.m. UTC | #1
Hello!

On 08.08.2019 9:38, Yoshihiro Shimoda wrote:

> Since the rcar_pwm_apply() has already check whehter state->enabled

    Checked?

> is not set or not, this patch removes a redundant condition.

    Is set or not?

> 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>
[...]

MBR, Sergei
Uwe Kleine-König Aug. 9, 2019, 9:10 a.m. UTC | #2
On Thu, Aug 08, 2019 at 12:55:40PM +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 08.08.2019 9:38, Yoshihiro Shimoda wrote:
> 
> > Since the rcar_pwm_apply() has already check whehter state->enabled
> 
>    Checked?

and "whether"

Best regards
Uwe
Yoshihiro Shimoda Aug. 19, 2019, 6:16 a.m. UTC | #3
Hello!

Thank you for your review! And, I'm sorry for the delayed response because I had a vacation.

> From: Uwe Kleine-Konig, Sent: Friday, August 9, 2019 6:11 PM
> 
> On Thu, Aug 08, 2019 at 12:55:40PM +0300, Sergei Shtylyov wrote:
> > Hello!
> >
> > On 08.08.2019 9:38, Yoshihiro Shimoda wrote:
> >
> > > Since the rcar_pwm_apply() has already check whehter state->enabled
> >
> >    Checked?
> 
> and "whether"

I'll revise it.

Best regards,
Yoshihiro Shimoda

> Best regards
> Uwe
> 
> 
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Patch
diff mbox series

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;