From: Bartosz Golaszewski Date: Sun, 24 Sep 2017 19:59:45 +0000 (+0200) Subject: simple: remove redundant line releases X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=349f7c203343139c6442509e071c129b08d939d5;p=qemu-gpiodev%2Flibgpiod.git simple: remove redundant line releases We're closing the chip right after calling the release routines in all three cases. The chip close function releases all line resources anyway so no need to do it twice. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/lib/simple.c b/src/lib/simple.c index 2b23e4b..12766e6 100644 --- a/src/lib/simple.c +++ b/src/lib/simple.c @@ -70,7 +70,6 @@ int gpiod_simple_get_value_multiple(const char *consumer, const char *device, memset(values, 0, sizeof(*values) * num_lines); status = gpiod_line_get_value_bulk(&bulk, values); - gpiod_line_release_bulk(&bulk); gpiod_chip_close(chip); return status; @@ -130,7 +129,6 @@ int gpiod_simple_set_value_multiple(const char *consumer, const char *device, if (cb) cb(data); - gpiod_line_release_bulk(&bulk); gpiod_chip_close(chip); return 0; @@ -192,7 +190,6 @@ int gpiod_simple_event_loop(const char *consumer, const char *device, } out: - gpiod_line_release(line); gpiod_chip_close(chip); return status;