From: Julien Panis <jpanis@baylibre.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
William Breathitt Gray <wbg@kernel.org>
Cc: linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
linux-iio@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH] counter: ti-ecap-capture: use regmap_assign_bits() for conditional set/clear
Date: Thu, 24 Sep 2026 12:11:47 +0200 [thread overview]
Message-ID: <f5314ab6-e29e-4f92-8006-3679b1b28f5c@baylibre.com> (raw)
In-Reply-To: <20260924083448.461792-1-peng.fan@oss.nxp.com>
On 9/24/26 10:34, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Replace if/else block using regmap_set_bits()/regmap_clear_bits() with
> the simpler regmap_assign_bits() call.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/counter/ti-ecap-capture.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
> index d77a256f0ed31..1b79031544646 100644
> --- a/drivers/counter/ti-ecap-capture.c
> +++ b/drivers/counter/ti-ecap-capture.c
> @@ -254,10 +254,8 @@ static int ecap_cnt_pol_write(struct counter_device *counter,
> struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
>
> pm_runtime_get_sync(counter->parent);
> - if (pol == COUNTER_SIGNAL_POLARITY_NEGATIVE)
> - regmap_set_bits(ecap_dev->regmap, ECAP_ECCTL_REG, ECAP_CAPPOL_BIT(idx));
> - else
> - regmap_clear_bits(ecap_dev->regmap, ECAP_ECCTL_REG, ECAP_CAPPOL_BIT(idx));
> + regmap_assign_bits(ecap_dev->regmap, ECAP_ECCTL_REG, ECAP_CAPPOL_BIT(idx),
> + pol == COUNTER_SIGNAL_POLARITY_NEGATIVE);
> pm_runtime_put_sync(counter->parent);
>
> return 0;
Acked-by: Julien Panis <jpanis@baylibre.com>
prev parent reply other threads:[~2026-09-24 10:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 8:34 Peng Fan (OSS)
2026-09-24 10:11 ` Julien Panis [this message]
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=f5314ab6-e29e-4f92-8006-3679b1b28f5c@baylibre.com \
--to=jpanis@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=vigneshr@ti.com \
--cc=wbg@kernel.org \
/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
all inboxes | Powered by JetHome®