* [PATCH] iio: chemical: ens160: use regmap_assign_bits() for conditional set/clear
@ 2026-09-24 8:35 Peng Fan (OSS)
2026-09-24 11:29 ` Joshua Crofts
2026-09-24 14:21 ` Andy Shevchenko
0 siblings, 2 replies; 3+ messages in thread
From: Peng Fan (OSS) @ 2026-09-24 8:35 UTC (permalink / raw)
To: Gustavo Silva, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
Cc: linux-kernel, Peng Fan, linux-iio
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: chemical: ens160: use regmap_assign_bits() for conditional set/clear
2026-09-24 8:35 [PATCH] iio: chemical: ens160: use regmap_assign_bits() for conditional set/clear Peng Fan (OSS)
@ 2026-09-24 11:29 ` Joshua Crofts
2026-09-24 14:21 ` Andy Shevchenko
1 sibling, 0 replies; 3+ messages in thread
From: Joshua Crofts @ 2026-09-24 11:29 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Gustavo Silva, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-kernel, Peng Fan, linux-iio
On Thu, 24 Sep 2026 16:35:26 +0800
"Peng Fan (OSS)" <peng.fan@oss.nxp.com> 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>
> ---
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: chemical: ens160: use regmap_assign_bits() for conditional set/clear
2026-09-24 8:35 [PATCH] iio: chemical: ens160: use regmap_assign_bits() for conditional set/clear Peng Fan (OSS)
2026-09-24 11:29 ` Joshua Crofts
@ 2026-09-24 14:21 ` Andy Shevchenko
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-09-24 14:21 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Gustavo Silva, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-kernel, Peng Fan, linux-iio
On Thu, Sep 24, 2026 at 04:35:26PM +0800, Peng Fan (OSS) wrote:
> Replace if/else block using regmap_set_bits()/regmap_clear_bits() with
> the simpler regmap_assign_bits() call.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-24 14:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 8:35 [PATCH] iio: chemical: ens160: use regmap_assign_bits() for conditional set/clear Peng Fan (OSS)
2026-09-24 11:29 ` Joshua Crofts
2026-09-24 14:21 ` Andy Shevchenko
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®