Files
linux/drivers
Geert Uytterhoeven 86673e9331 gpio: Move freeing of GPIO hogs before numbing of the device
commit 5018ada69a upstream.

When removing a gpiochip that uses GPIO hogging (e.g. by unloading the
chip's DT overlay), a warning is printed:

    gpio gpiochip8: REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED

This happens because gpiochip_free_hogs() is called after the gdev->chip
pointer is reset to NULL. Hence __gpiod_free() cannot determine the
chip in use, and cannot clear flags nor call the optional chip-specific
.free() callback.

Move the call to gpiochip_free_hogs() up to fix this.

Fixes: ff2b135922 ("gpio: make the gpiochip a real device")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19 20:18:00 +01:00
..
2016-12-05 14:53:46 -05:00
2017-01-19 20:17:58 +01:00
2016-09-27 12:33:47 +02:00
2016-09-20 20:57:12 +10:00
2016-11-29 16:43:24 +01:00
2017-01-12 11:39:29 +01:00
2016-11-01 09:04:04 -06:00