From: Bartosz Golaszewski Date: Mon, 30 Jan 2017 11:02:07 +0000 (+0100) Subject: core: fix requesting events X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e0b6e5460af2e675d6905a7f1a1eccc2f4fbc624;p=qemu-gpiodev%2Flibgpiod.git core: fix requesting events There was a bitwise OR and assignment operator in an 'if else' instead of an equality operator when requesting 'both edges' events. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/lib/core.c b/src/lib/core.c index 2cede39..55f144b 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -774,7 +774,7 @@ int gpiod_line_event_request(struct gpiod_line *line, req->eventflags |= GPIOEVENT_EVENT_RISING_EDGE; else if (config->event_type == GPIOD_EVENT_FALLING_EDGE) req->eventflags |= GPIOEVENT_EVENT_FALLING_EDGE; - else if (req->eventflags |= GPIOD_EVENT_BOTH_EDGES) + else if (req->eventflags == GPIOD_EVENT_BOTH_EDGES) req->eventflags |= GPIOEVENT_REQUEST_BOTH_EDGES; chip = gpiod_line_get_chip(line);