Geert Uytterhoeven 5018ada69a gpio: Move freeing of GPIO hogs before numbing of the device
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.

Cc: stable@vger.kernel.org
Fixes: ff2b135922992756 ("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>
2016-12-30 09:11:21 +01:00
..
2016-03-30 10:38:51 +02:00
2016-10-24 00:23:05 +02:00
2016-01-05 11:21:05 +01:00
2016-02-16 00:19:53 +01:00
2016-12-30 09:02:51 +01:00
2016-01-05 15:46:34 +01:00
2016-09-13 10:35:56 +02:00