From: Bartosz Golaszewski Date: Fri, 6 Jan 2017 10:01:25 +0000 (+0100) Subject: core: remove gpiod_chip_get_fd() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e735361820b41cc5b141a491da988dcb5078da0b;p=qemu-gpiodev%2Flibgpiod.git core: remove gpiod_chip_get_fd() With current functionality offered by the library, there's no need for the user to directly access the gpiochip file descriptor. Signed-off-by: Bartosz Golaszewski --- diff --git a/core.c b/core.c index f6019cd..a66c052 100644 --- a/core.c +++ b/core.c @@ -220,7 +220,7 @@ int gpiod_line_update(struct gpiod_line *line) line->info.flags = 0; chip = gpiod_line_get_chip(line); - fd = gpiod_chip_get_fd(chip); + fd = chip->fd; status = gpio_ioctl(fd, GPIO_GET_LINEINFO_IOCTL, &line->info); if (status < 0) @@ -301,7 +301,7 @@ int gpiod_line_request_bulk(struct gpiod_line_bulk *line_bulk, sizeof(req->consumer_label) - 1); chip = gpiod_line_get_chip(line_bulk->lines[0]); - fd = gpiod_chip_get_fd(chip); + fd = chip->fd; status = gpio_ioctl(fd, GPIO_GET_LINEHANDLE_IOCTL, req); if (status < 0) @@ -479,7 +479,7 @@ int gpiod_line_event_request(struct gpiod_line *line, req->eventflags |= GPIOEVENT_REQUEST_BOTH_EDGES; chip = gpiod_line_get_chip(line); - fd = gpiod_chip_get_fd(chip); + fd = chip->fd; status = gpio_ioctl(fd, GPIO_GET_LINEEVENT_IOCTL, req); if (status < 0) @@ -703,11 +703,6 @@ gpiod_chip_get_line(struct gpiod_chip *chip, unsigned int offset) return line; } -int gpiod_chip_get_fd(struct gpiod_chip *chip) -{ - return chip->fd; -} - struct gpiod_chip * gpiod_line_get_chip(struct gpiod_line *line) { return line->chip; diff --git a/gpiod.h b/gpiod.h index 5b6d922..ec191c7 100644 --- a/gpiod.h +++ b/gpiod.h @@ -593,9 +593,6 @@ unsigned int gpiod_chip_num_lines(struct gpiod_chip *chip) GPIOD_API; struct gpiod_line * gpiod_chip_get_line(struct gpiod_chip *chip, unsigned int offset) GPIOD_API; -/* FIXME This shouldn't be needed. Make it private maybe? */ -int gpiod_chip_get_fd(struct gpiod_chip *chip) GPIOD_API; - /** * @} *