diff mbox series

[libgpiod] line-config.c: Fix library enum used for kernel flags bitfield

Message ID Pine.LNX.4.64.2312301347330.29540@wormhole.robuust.nl
State New
Headers show
Series [libgpiod] line-config.c: Fix library enum used for kernel flags bitfield | expand

Commit Message

J.A. Bezemer Dec. 30, 2023, 12:48 p.m. UTC
Library enum was used to sanitize kernel flags.

This will probably not have broken any "correct" usage: it would clear
GPIO_V2_LINE_FLAG_USED, which is not used on setting, and
GPIO_V2_LINE_FLAG_ACTIVE_LOW, which is set correctly later on.

Signed-off-by: Anne Bezemer <j.a.bezemer@opensourcepartners.nl>
---
  lib/line-config.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/line-config.c b/lib/line-config.c
index 2749a2a..9bf7734 100644
--- a/lib/line-config.c
+++ b/lib/line-config.c
@@ -381,18 +381,18 @@  static uint64_t make_kernel_flags(struct gpiod_line_settings *settings)
  	case GPIOD_LINE_EDGE_FALLING:
  		flags |= (GPIO_V2_LINE_FLAG_EDGE_FALLING |
  			  GPIO_V2_LINE_FLAG_INPUT);
-		flags &= ~GPIOD_LINE_DIRECTION_OUTPUT;
+		flags &= ~GPIO_V2_LINE_FLAG_OUTPUT;
  		break;
  	case GPIOD_LINE_EDGE_RISING:
  		flags |= (GPIO_V2_LINE_FLAG_EDGE_RISING |
  			  GPIO_V2_LINE_FLAG_INPUT);
-		flags &= ~GPIOD_LINE_DIRECTION_OUTPUT;
+		flags &= ~GPIO_V2_LINE_FLAG_OUTPUT;
  		break;
  	case GPIOD_LINE_EDGE_BOTH:
  		flags |= (GPIO_V2_LINE_FLAG_EDGE_FALLING |
  			  GPIO_V2_LINE_FLAG_EDGE_RISING |
  			  GPIO_V2_LINE_FLAG_INPUT);
-		flags &= ~GPIOD_LINE_DIRECTION_OUTPUT;
+		flags &= ~GPIO_V2_LINE_FLAG_OUTPUT;
  		break;
  	default:
  		break;