Re: [PATCH V3 2/2] Add support for Awinic proximity sensor

From: Markus Elfring
Date: Fri Jul 12 2024 - 10:33:44 EST


Please add a subsystem specification to the message subject.



> +++ b/drivers/iio/proximity/aw_sar.c
> @@ -0,0 +1,1850 @@

> +static ssize_t
> +update_reg_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
> +{

> + if (flag == AW_TRUE) {
> + mutex_lock(&aw_sar_lock);
> + aw_sar_soft_reset(p_sar);
> + aw_sar_update_reg_set_func(p_sar);
> + mutex_unlock(&aw_sar_lock);
> + }
> +
> + return count;
> +}


Under which circumstances would you become interested to apply a statement
like “guard(mutex)(&aw_sar_lock);”?
https://elixir.bootlin.com/linux/v6.10-rc7/source/include/linux/mutex.h#L196

Regards,
Markus