Re: [PATCH 1/4] iio: pressure: mpl3115: convert probe to fully devm managed

SeungJu Cheon <[email protected]> Sun, 31 May 2026 19:46:25 +0900
Newsgroups dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-iio
Message-ID <CAGwK=3qst8kdMmUeHvbB7omkEv7N+_+eqP04Bqcy4YyVpHpwLA@mail.gmail.com>
Hi Andy, thanks for the review.

On Sat, May 30, 2026 at 9:13 PM Andy Shevchenko
<[email protected]> wrote:
> > +static int mpl3115_suspend(struct device *dev)
> > +{
> > +       struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
>
> What's wrong with dev_get_drvdata() ?

Nothing, you're right. Will use dev_get_drvdata() in v2.

> Ditto.

Same, will fix.

> You forgot about mutex_init().

mutex_init(&data->lock) is already present in probe(), but I agree
that converting it to devm_mutex_init() fits better with the devm
conversion. I'll update this in v2.

> Add
>   struct device *dev = &client->dev;
> to the top of the function to make this shorter and easier to read.

Will do.

> Split moving of this function to a separate prerequisite patch.

Will split the function move into its own prerequisite patch in v2.

> > -static int mpl3115_suspend(struct device *dev)
> > -static int mpl3115_resume(struct device *dev)
>
> Why did you touch these two?

No good reason -- I only reworked them to flatten the nested
i2c_get_clientdata(to_i2c_client()) call. Since that's unrelated to
this patch, I'll leave them untouched here and do the minimal move
only, as Jonathan also suggested.

Thanks for the review.