The getter functions retrieving the file descriptors (both for events
and line values) check the line state internally but we don't check
their return values and just pass them on to ioctl()s. Drop the checks
altogether.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
static int line_get_handle_fd(struct gpiod_line *line)
{
- int state = line_get_state(line);
-
- return state == LINE_REQUESTED_VALUES ? line->handle->request.fd : -1;
+ return line->handle->request.fd;
}
static int line_get_event_fd(struct gpiod_line *line)
{
- return line_get_state(line) == LINE_REQUESTED_EVENTS
- ? line->event.fd : -1;
+ return line->event.fd;
}
static void line_set_handle(struct gpiod_line *line,