]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: Fix inverted check in gpiochip_remove()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 2 Mar 2020 08:24:48 +0000 (09:24 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 3 Mar 2020 12:33:02 +0000 (13:33 +0100)
commitd39e62aefb1c42549c9f2afd9c547cb0f997de24
tree16b25f36b019e37b7db444db6bc3adc22a958d82
parentcc2f86e463b4ce3f3bfce90d1708a3692d7d70ad
gpiolib: Fix inverted check in gpiochip_remove()

The optimization to check for requested lines actually optimized for the
uncomon error case, where one of the GPIO lines is still in use.
Hence the error message must be printed when the loop is terminated
early, not when it went through all available GPIO lines.

Fixes: cc2f86e463b4ce3f ("gpiolib: Optimize gpiochip_remove() when check for requested line")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20200302082448.11795-1-geert+renesas@glider.be
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c