]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: only check line handle flags once
authorBartosz Golaszewski <brgl@bgdev.pl>
Mon, 16 Oct 2017 09:32:29 +0000 (11:32 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 19 Oct 2017 20:32:39 +0000 (22:32 +0200)
commit13b0f5075d50037b9f88b041cd3327ff38b8b9c1
treec39b97bc1181c875c04e90187d0140899e4126bf
parentfdce308861dc6708c432b4c3d18b2eca1d458103
gpiolib: only check line handle flags once

There's no need to check the validity of handle request flags more
than once, right after copying the data from user. Move the check
out of the for loop and simplify the error path by bailing out before
allocating any resources.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c