From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: "Gustavo Silva" <gustavograzs@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>
Cc: linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
linux-iio@vger.kernel.org
Subject: [PATCH] iio: chemical: ens160: use regmap_assign_bits() for conditional set/clear
Date: Thu, 24 Sep 2026 16:35:26 +0800 [thread overview]
Message-ID: <20260924083527.461864-1-peng.fan@oss.nxp.com> (raw)
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/iio/chemical/ens160_core.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/iio/chemical/ens160_core.c b/drivers/iio/chemical/ens160_core.c
index 7c1ffda38b99c..5e2b15463c99e 100644
--- a/drivers/iio/chemical/ens160_core.c
+++ b/drivers/iio/chemical/ens160_core.c
@@ -283,12 +283,7 @@ static int ens160_set_trigger_state(struct iio_trigger *trig, bool state)
ENS160_REG_CONFIG_INTDAT |
ENS160_REG_CONFIG_INT_CFG;
- if (state)
- return regmap_set_bits(data->regmap, ENS160_REG_CONFIG,
- int_bits);
- else
- return regmap_clear_bits(data->regmap, ENS160_REG_CONFIG,
- int_bits);
+ return regmap_assign_bits(data->regmap, ENS160_REG_CONFIG, int_bits, state);
}
static const struct iio_trigger_ops ens160_trigger_ops = {
--
2.50.1
next reply other threads:[~2026-09-24 8:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 8:35 Peng Fan (OSS) [this message]
2026-09-24 11:29 ` Joshua Crofts
2026-09-24 14:21 ` Andy Shevchenko
2026-09-25 3:28 ` Jonathan Cameron
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=20260924083527.461864-1-peng.fan@oss.nxp.com \
--to=peng.fan@oss.nxp.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gustavograzs@gmail.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=peng.fan@nxp.com \
/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®