linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.com>
Cc: Mark Brown <broonie@kernel.org>, <linux-pwm@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>, <kernel@pengutronix.de>
Subject: Re: [PATCH 4/5] pwm: stm32-lp: Use regmap_clear_bits and regmap_set_bits where applicable
Date: Wed, 23 Nov 2022 11:23:14 +0100	[thread overview]
Message-ID: <b474ef48-f77b-807b-ce12-f5a200459933@foss.st.com> (raw)
In-Reply-To: <20221115111347.3705732-5-u.kleine-koenig@pengutronix.de>

On 11/15/22 12:13, Uwe Kleine-König wrote:
> Found using coccinelle and the following semantic patch:
> 
> @@
> expression map, reg, bits;
> @@
> 
> - regmap_update_bits(map, reg, bits, bits)
> + regmap_set_bits(map, reg, bits)
> 
> @@
> expression map, reg, bits;
> @@
> 
> - regmap_update_bits(map, reg, bits, 0)
> + regmap_clear_bits(map, reg, bits)
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/pwm/pwm-stm32-lp.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
> index 3115abb3f52a..212bdc7d51ee 100644
> --- a/drivers/pwm/pwm-stm32-lp.c
> +++ b/drivers/pwm/pwm-stm32-lp.c
> @@ -140,9 +140,8 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip, struct pwm_device *pwm,
>  
>  	if (reenable) {
>  		/* Start LP timer in continuous mode */
> -		ret = regmap_update_bits(priv->regmap, STM32_LPTIM_CR,
> -					 STM32_LPTIM_CNTSTRT,
> -					 STM32_LPTIM_CNTSTRT);
> +		ret = regmap_set_bits(priv->regmap, STM32_LPTIM_CR,
> +				      STM32_LPTIM_CNTSTRT);

Hi Uwe,

One minor suggestion here: could fit into a single line.

You can add my:
Tested-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>

Best Regards,
Thanks
Fabrice

>  		if (ret) {
>  			regmap_write(priv->regmap, STM32_LPTIM_CR, 0);
>  			goto err;

  reply	other threads:[~2022-11-23 10:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 11:13 [PATCH 0/5] pwm: Use regmap_clear_bits and regmap_set_bits where applicable Uwe Kleine-König
2022-11-15 11:13 ` [PATCH 1/5] pwm: fsl-ftm: " Uwe Kleine-König
2022-11-15 11:13 ` [PATCH 2/5] pwm: img: " Uwe Kleine-König
2022-11-15 11:13 ` [PATCH 3/5] pwm: iqs620a: " Uwe Kleine-König
2022-11-15 11:13 ` [PATCH 4/5] pwm: stm32-lp: " Uwe Kleine-König
2022-11-23 10:23   ` Fabrice Gasnier [this message]
2022-12-02 17:57     ` Uwe Kleine-König
2022-11-15 11:13 ` [PATCH 5/5] pwm: stm32: " Uwe Kleine-König
2022-11-23 10:23   ` Fabrice Gasnier
2022-11-17 13:52 ` [PATCH 0/5] pwm: " Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b474ef48-f77b-807b-ce12-f5a200459933@foss.st.com \
    --to=fabrice.gasnier@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=broonie@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).