aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-01-04 14:50:58 +0100
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-01-05 09:48:49 +0100
commit8e2e30e70bafce6131f9345e8b48f0c33e088480 (patch)
tree425018f1e9f7e1e97bcf95502c5a3f81b075fb12
parentb07d076e3213d09781e2d977a9cc85713e5f45c5 (diff)
downloadlibgpiod-8e2e30e70bafce6131f9345e8b48f0c33e088480.tar.gz
core: remove buggy flags sanitization from line-config
We try to drop potentially set output flags from line config if edge detection is enabled but we use the library enum instead of the one from the uAPI. In any case, we should actually loudly complain if user tries to use the output mode with edge-detection (like we do currently) so just remove offending lines entirely. Reported-by: Anne Bezemer <j.a.bezemer@opensourcepartners.nl> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Anne Bezemer <j.a.bezemer@opensourcepartners.nl>
-rw-r--r--lib/line-config.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/line-config.c b/lib/line-config.c
index 2749a2a0..9302c1bd 100644
--- a/lib/line-config.c
+++ b/lib/line-config.c
@@ -381,18 +381,15 @@ 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;
break;
case GPIOD_LINE_EDGE_RISING:
flags |= (GPIO_V2_LINE_FLAG_EDGE_RISING |
GPIO_V2_LINE_FLAG_INPUT);
- flags &= ~GPIOD_LINE_DIRECTION_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;
break;
default:
break;