Skip to contentSkip to conversation

gpiolib: remove unneeded WARN_ON() from gpiochip_set_multiple()

PATCH Applied Bartosz Golaszewski 2 participants 3 messages Feb 27, 2025 – Mar 3, 2025 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: remove unneeded WARN_ON() from gpiochip_set_multiple()

From: Bartosz Golaszewski <[email protected]>

GPIO drivers are not required to support set_multiple() - the core will fallback to calling set() for each line if it's missing. Remove the offending check from gpiochip_set_multiple().

Fixes 98ce1eb1fd87 ("gpiolib: introduce gpio_chip setters that return values")
---
 drivers/gpio/gpiolib.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpio/gpiolib.c +0 -3
index 1b4af0f97e5a..6cfbc8869cf8 100644
@@ -3608,9 +3608,6 @@ static int gpiochip_set_multiple(struct gpio_chip *gc,
 
 	lockdep_assert_held(&gc->gpiodev->srcu);
 
-	if (WARN_ON(unlikely(!gc->set_multiple && !gc->set_multiple_rv)))
-		return -EOPNOTSUPP;
-
 	if (gc->set_multiple_rv) {
 		ret = gc->set_multiple_rv(gc, mask, bits);
 		if (ret > 0)
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

GPIO drivers are not required to support set_multiple() - the core will fallback to calling set() for each line if it's missing. Remove the offending check from gpiochip_set_multiple().

Fixes 98ce1eb1fd87 ("gpiolib: introduce gpio_chip setters that return values")

That's right.

Yours,
Linus Walleij

author Applied
#2 lore raw
In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Quoted 5 lines · Bartosz Golaszewski

GPIO drivers are not required to support set_multiple() - the core will fallback to calling set() for each line if it's missing. Remove the offending check from gpiochip_set_multiple().

Applied, thanks!

[1/1] gpiolib: remove unneeded WARN_ON() from gpiochip_set_multiple()

      commit: 8014097f1466f7e034844770c537b8dc7d98811f

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>