Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v2] gpiolib: Allow to use setters with return value for output-only gpios
@ 2025-04-11 14:52 Mathieu Dubois-Briand
  2025-04-13 20:00 ` Bartosz Golaszewski
  2025-04-14  2:08 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Mathieu Dubois-Briand @ 2025-04-11 14:52 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Uwe Kleine-König
  Cc: linux-gpio, linux-kernel, stable, Thomas Petazzoni,
	Bartosz Golaszewski, Mathieu Dubois-Briand

The gpiod_direction_output_raw_commit() function checks if any setter
callback is present before doing anything. As the new GPIO setters with
return values were introduced, make this check also succeed if one is
present.

Fixes: 98ce1eb1fd87 ("gpiolib: introduce gpio_chip setters that return values")
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
---
Changes in v2:
- Add Fixes: tag and Cc: to stable
- Link to v1: https://lore.kernel.org/r/20250411-mdb-gpiolib-setters-fix-v1-1-dea302ab7440@bootlin.com
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index b8197502a5ac..cd4fecbb41f2 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2879,7 +2879,7 @@ static int gpiod_direction_output_raw_commit(struct gpio_desc *desc, int value)
 	 * output-only, but if there is then not even a .set() operation it
 	 * is pretty tricky to drive the output line.
 	 */
-	if (!guard.gc->set && !guard.gc->direction_output) {
+	if (!guard.gc->set && !guard.gc->set_rv && !guard.gc->direction_output) {
 		gpiod_warn(desc,
 			   "%s: missing set() and direction_output() operations\n",
 			   __func__);

---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250411-mdb-gpiolib-setters-fix-b87976992070

Best regards,
-- 
Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>


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

* Re: [PATCH v2] gpiolib: Allow to use setters with return value for output-only gpios
  2025-04-11 14:52 [PATCH v2] gpiolib: Allow to use setters with return value for output-only gpios Mathieu Dubois-Briand
@ 2025-04-13 20:00 ` Bartosz Golaszewski
  2025-04-14  2:08 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2025-04-13 20:00 UTC (permalink / raw)
  To: Linus Walleij, Uwe Kleine-König, Mathieu Dubois-Briand
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, stable,
	Thomas Petazzoni, Bartosz Golaszewski


On Fri, 11 Apr 2025 16:52:09 +0200, Mathieu Dubois-Briand wrote:
> The gpiod_direction_output_raw_commit() function checks if any setter
> callback is present before doing anything. As the new GPIO setters with
> return values were introduced, make this check also succeed if one is
> present.
> 
> 

Applied, thanks!

[1/1] gpiolib: Allow to use setters with return value for output-only gpios
      https://git.kernel.org/brgl/linux/c/93eb2c1249eadce4bbc1914092f34f5988be13af

Best regards,
-- 
Bartosz Golaszewski <brgl@bgdev.pl>

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

* Re: [PATCH v2] gpiolib: Allow to use setters with return value for output-only gpios
  2025-04-11 14:52 [PATCH v2] gpiolib: Allow to use setters with return value for output-only gpios Mathieu Dubois-Briand
  2025-04-13 20:00 ` Bartosz Golaszewski
@ 2025-04-14  2:08 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-04-14  2:08 UTC (permalink / raw)
  To: Mathieu Dubois-Briand; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1

Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH v2] gpiolib: Allow to use setters with return value for output-only gpios
Link: https://lore.kernel.org/stable/20250411-mdb-gpiolib-setters-fix-v2-1-9611280d8822%40bootlin.com

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




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

end of thread, other threads:[~2025-04-14  2:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-11 14:52 [PATCH v2] gpiolib: Allow to use setters with return value for output-only gpios Mathieu Dubois-Briand
2025-04-13 20:00 ` Bartosz Golaszewski
2025-04-14  2:08 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox