Skip to content

Commit b424bb8

Browse files
mbriandbrgl
authored andcommitted
gpiolib: Allow to use setters with return value for output-only gpios
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: 98ce1eb ("gpiolib: introduce gpio_chip setters that return values") Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Link: https://lore.kernel.org/r/20250411-mdb-gpiolib-setters-fix-v2-1-9611280d8822@bootlin.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
1 parent 8ffd015 commit b424bb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpiolib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2879,7 +2879,7 @@ static int gpiod_direction_output_raw_commit(struct gpio_desc *desc, int value)
28792879
* output-only, but if there is then not even a .set() operation it
28802880
* is pretty tricky to drive the output line.
28812881
*/
2882-
if (!guard.gc->set && !guard.gc->direction_output) {
2882+
if (!guard.gc->set && !guard.gc->set_rv && !guard.gc->direction_output) {
28832883
gpiod_warn(desc,
28842884
"%s: missing set() and direction_output() operations\n",
28852885
__func__);

0 commit comments

Comments
 (0)