core: kill gpio_ioctl()
authorBartosz Golaszewski <bartekgola@gmail.com>
Sat, 24 Jun 2017 10:32:01 +0000 (12:32 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Thu, 6 Jul 2017 09:11:36 +0000 (11:11 +0200)
We used this wrapper around ioctl() to set the libgpiod-specific error
number if the ioctl() call failed.

We no longer use custom error numbers, so remove this function.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/lib/core.c

index 8d386941cd54b84e0fe166acd298debbb4270bfe..e23539470655aae60e5bd7508bf386fec3be4876 100644 (file)
@@ -93,11 +93,6 @@ static void nsec_to_timespec(uint64_t nsec, struct timespec *ts)
        ts->tv_nsec = (nsec % 1000000000ULL);
 }
 
-static int gpio_ioctl(int fd, unsigned long request, void *data)
-{
-       return ioctl(fd, request, data);
-}
-
 int gpiod_simple_get_value_multiple(const char *consumer, const char *device,
                                    const unsigned int *offsets, int *values,
                                    unsigned int num_lines, bool active_low)
@@ -405,7 +400,7 @@ int gpiod_line_update(struct gpiod_line *line)
        chip = gpiod_line_get_chip(line);
        fd = chip->fd;
 
-       status = gpio_ioctl(fd, GPIO_GET_LINEINFO_IOCTL, &line->info);
+       status = ioctl(fd, GPIO_GET_LINEINFO_IOCTL, &line->info);
        if (status < 0)
                return -1;
 
@@ -524,7 +519,7 @@ int gpiod_line_request_bulk(struct gpiod_line_bulk *bulk,
        chip = gpiod_line_get_chip(bulk->lines[0]);
        fd = chip->fd;
 
-       status = gpio_ioctl(fd, GPIO_GET_LINEHANDLE_IOCTL, req);
+       status = ioctl(fd, GPIO_GET_LINEHANDLE_IOCTL, req);
        if (status < 0)
                return -1;
 
@@ -637,7 +632,7 @@ int gpiod_line_get_value_bulk(struct gpiod_line_bulk *bulk, int *values)
        else
                fd = line_get_event_fd(first);
 
-       status = gpio_ioctl(fd, GPIOHANDLE_GET_LINE_VALUES_IOCTL, &data);
+       status = ioctl(fd, GPIOHANDLE_GET_LINE_VALUES_IOCTL, &data);
        if (status < 0)
                return -1;
 
@@ -673,7 +668,7 @@ int gpiod_line_set_value_bulk(struct gpiod_line_bulk *bulk, int *values)
        for (i = 0; i < bulk->num_lines; i++)
                data.values[i] = (uint8_t)!!values[i];
 
-       status = gpio_ioctl(line_get_handle_fd(bulk->lines[0]),
+       status = ioctl(line_get_handle_fd(bulk->lines[0]),
                            GPIOHANDLE_SET_LINE_VALUES_IOCTL, &data);
        if (status < 0)
                return -1;
@@ -756,7 +751,7 @@ int gpiod_line_event_request(struct gpiod_line *line,
        chip = gpiod_line_get_chip(line);
        fd = chip->fd;
 
-       status = gpio_ioctl(fd, GPIO_GET_LINEEVENT_IOCTL, req);
+       status = ioctl(fd, GPIO_GET_LINEEVENT_IOCTL, req);
        if (status < 0)
                return -1;
 
@@ -919,7 +914,7 @@ struct gpiod_chip * gpiod_chip_open(const char *path)
 
        chip->fd = fd;
 
-       status = gpio_ioctl(fd, GPIO_GET_CHIPINFO_IOCTL, &chip->cinfo);
+       status = ioctl(fd, GPIO_GET_CHIPINFO_IOCTL, &chip->cinfo);
        if (status < 0) {
                close(chip->fd);
                free(chip);