Re: [PATCH v3 3/6] iio: light: vcnl4000: replace mutex_init with devm_mutex_init

Andy Shevchenko
2026-03-16T10:24:26Z

On Sat, Mar 14, 2026 at 06:06:32PM +0200, Erikas Bitovtas wrote:
> Replace mutex_init used across driver with its device-managed
> counterpart, so all assigned mutexes get destroyed.

...

> + ret = devm_mutex_init(dev, &data->vcnl4200_al.lock);
> + if (ret < 0)

Do we need ' < 0' parts?

> + return ret;
> +
> + ret = devm_mutex_init(dev, &data->vcnl4200_ps.lock);
> + if (ret < 0)
> + return ret;

...

> + ret = devm_mutex_init(dev, &data->vcnl4000_lock);
> + if (ret < 0)
> + return ret;

Ditto.

--
With Best Regards,
Andy Shevchenko