Re: [PATCH v2 2/2] gpiolib: use a mutex to protect the list of GPIO devices

From: Bartosz Golaszewski
Date: Thu Dec 14 2023 - 07:26:40 EST


On Fri, Dec 8, 2023 at 11:20 AM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> The global list of GPIO devices is never modified or accessed from
> atomic context so it's fine to protect it using a mutex. Add a new
> global lock dedicated to the gpio_devices list and use it whenever
> accessing or modifying it.
>
> While at it: fold the sysfs registering of existing devices into
> gpiolib.c and make gpio_devices static within its compilation unit.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

If there are no objections, I'll apply it tomorrow.

Bart