diff options
author | Kent Gibson <warthog618@gmail.com> | 2022-07-14 10:03:14 +0800 |
---|---|---|
committer | Bartosz Golaszewski <brgl@bgdev.pl> | 2022-07-19 10:01:22 +0200 |
commit | 160d6e402900672d4b0689a7c939be487460a1fe (patch) | |
tree | 4a7db25682f4a4c4d290b0c086cad446a9d666eb /drivers/gpio | |
parent | 3e2d53b2734bea05dba4f8fa94332ad6dd343712 (diff) | |
download | linux-160d6e402900672d4b0689a7c939be487460a1fe.tar.gz linux-160d6e402900672d4b0689a7c939be487460a1fe.tar.bz2 linux-160d6e402900672d4b0689a7c939be487460a1fe.zip |
gpiolib: cdev: simplify linereq_free
The edge detector is only ever started after the line desc has been
determined, so move edge_detector_stop() inside the line desc check,
and merge the two checked regions into one.
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Dipen Patel <dipenp@nvidia.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib-cdev.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index 0c9a63becfef..b44526e3630e 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -1460,15 +1460,15 @@ static ssize_t linereq_read(struct file *file, static void linereq_free(struct linereq *lr) { unsigned int i; - bool hte = false; + bool hte; for (i = 0; i < lr->num_lines; i++) { - if (lr->lines[i].desc) + if (lr->lines[i].desc) { hte = !!test_bit(FLAG_EVENT_CLOCK_HTE, &lr->lines[i].desc->flags); - edge_detector_stop(&lr->lines[i], hte); - if (lr->lines[i].desc) + edge_detector_stop(&lr->lines[i], hte); gpiod_free(lr->lines[i].desc); + } } kfifo_free(&lr->events); kfree(lr->label); |