Re: [PATCH v3 7/7] iio: light: opt3001: add comment to mutex

From: Jonathan Cameron

Date: Fri May 22 2026 - 10:18:37 EST


On Thu, 21 May 2026 11:55:44 +0200
Joshua Crofts via B4 Relay <devnull+joshua.crofts1.gmail.com@xxxxxxxxxx> wrote:

> From: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
>
> Add comment to mutex per checkpatch.pl report.
>
> No functional change.
>
> Reviewed-by: Maxwell Doose <m32285159@xxxxxxxxx>
> Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
> ---
> drivers/iio/light/opt3001.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c
> index ac1c7ba5679867f6b814894680e317615f2e373b..9d24d7a23ef00d160fdae737b6ea1943576a3fcf 100644
> --- a/drivers/iio/light/opt3001.c
> +++ b/drivers/iio/light/opt3001.c
> @@ -103,6 +103,7 @@ struct opt3001_chip_info {
> struct opt3001 {
> struct i2c_client *client;
>
> + /* Mutex for ensuring one executed command at a time */

The device uses a 'register' type control scheme rather than
command based. So I'm not sure what intended meaning of this is.
I'd say something like

/*
* Ensure data capture sequences and read-modify-write
* sequences are not interrupted.
*/

At least from glancing at the driver I think that's why it's there.

> struct mutex lock;
> bool ok_to_ignore_lock;
This one is odd enough and coupled with the lock. Either comment on both of them
to say how they interact or add two comments.

> bool result_ready;
>