Re: [libgpiod v1.6.x][PATCH] tests: mockup: unbind mockup devices before unloading the module

From: Linus Walleij
Date: Thu Aug 24 2023 - 05:06:15 EST


On Mon, Aug 21, 2023 at 5:33 PM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:

> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> gpio-mockup relies on the GPIO devices being registered in module's __init
> function and them being unregistered in __exit. This works with the GPIO
> subsystem as it only takes a reference to the underlying owner module when
> a GPIO descriptor is requested and not when the GPIO device is
> instantiated.
>
> This behavior may change in the future in the kernel so make the behavior
> of libgpiomockup more correct and have it unbind all mockup devices over
> sysfs before unloading the module.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij