mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: wcove: use regmap_assign_bits() for conditional set/clear
@ 2026-09-24  8:35 Peng Fan (OSS)
  2026-09-25  8:14 ` Bartosz Golaszewski
  2026-09-25 10:13 ` Andy Shevchenko
  0 siblings, 2 replies; 9+ messages in thread
From: Peng Fan (OSS) @ 2026-09-24  8:35 UTC (permalink / raw)
  To: Andy Shevchenko, Kuppuswamy Sathyanarayanan, Linus Walleij,
	Bartosz Golaszewski
  Cc: linux-kernel, Peng Fan, linux-gpio

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/gpio/gpio-wcove.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-wcove.c b/drivers/gpio/gpio-wcove.c
index 4a5e20e936a95..937c5db7e6e49 100644
--- a/drivers/gpio/gpio-wcove.c
+++ b/drivers/gpio/gpio-wcove.c
@@ -129,10 +129,7 @@ static void wcove_update_irq_mask(struct wcove_gpio *wg, irq_hw_number_t gpio)
 {
 	unsigned int mask, reg = to_ireg(gpio, IRQ_MASK, &mask);
 
-	if (wg->set_irq_mask)
-		regmap_set_bits(wg->regmap, reg, mask);
-	else
-		regmap_clear_bits(wg->regmap, reg, mask);
+	regmap_assign_bits(wg->regmap, reg, mask, wg->set_irq_mask);
 }
 
 static void wcove_update_irq_ctrl(struct wcove_gpio *wg, irq_hw_number_t gpio)
-- 
2.50.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-25 13:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24  8:35 [PATCH] gpio: wcove: use regmap_assign_bits() for conditional set/clear Peng Fan (OSS)
2026-09-25  8:14 ` Bartosz Golaszewski
2026-09-25  8:27   ` Andy Shevchenko
2026-09-25  9:54     ` Bartosz Golaszewski
2026-09-25 10:12       ` Andy Shevchenko
2026-09-25 10:23         ` Bartosz Golaszewski
2026-09-25 10:35           ` Andy Shevchenko
2026-09-25 13:58             ` Bartosz Golaszewski
2026-09-25 10:13 ` 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®