Re: [PATCH 2/2] Input: yealink - simplify locking in sysfs attribute handling

From: Greg KH
Date: Thu Jul 11 2024 - 03:42:56 EST


On Wed, Jul 10, 2024 at 04:48:54PM -0700, Dmitry Torokhov wrote:
> The locking rules in the driver came from era when sysfs attributes
> could live past the point of time when device would be unbound from
> the driver, and so used module-global semaphore (potentially shared
> between multiple yealink devices). Thankfully these times are long
> gone and attributes will not be accessible once they are removed.
>
> Simplify the logic by moving to per-device mutex, stop checking if
> there is driver data instance attached to the interface, and use
> guard notation to acquire the mutex.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>

Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>