[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAE3SzaQW0w9Zq57L9Qz9fwcqqARr1funORVr51hpqRBgBOapaQ@mail.gmail.com>
Date: Wed, 13 Aug 2025 19:05:05 +0530
From: Akshay Jindal <akshayaj.lkd@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: anshulusr@...il.com, jic23@...nel.org, dlechner@...libre.com,
nuno.sa@...log.com, andy@...nel.org, shuah@...nel.org,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] iio: light: ltr390: Add device powerdown functionality
via devm api
Sent a v3 for review. Acknowledged your comments inline.
On Wed, Aug 13, 2025 at 3:43 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Tue, Aug 12, 2025 at 7:07 PM Akshay Jindal <akshayaj.lkd@...il.com> wrote:
> >
> > Use devm_add_action_or_reset to do cleanup when the device is removed.
>
> devm_add_action_or_reset()
>
done
> > +static void ltr390_powerdown(void *client)
> > +{
> > + struct i2c_client *i2c_clnt = client;
> > + struct iio_dev *indio_dev = i2c_get_clientdata(i2c_clnt);
>
> Why? I mean why can't you simply provide a data pointer directly as a
> parameter to this function?
>
yeah that is much better. Done.
>
> > @@ -693,7 +711,7 @@ static int ltr390_probe(struct i2c_client *client)
> > return -ENOMEM;
> >
> > data = iio_priv(indio_dev);
> Stray change.
>
> > + i2c_set_clientdata(client, indio_dev);
>
> I would suggest moving this to be before data = ... line above. And
> add a blank line after it. BUT, read above first.
>
Done.
Powered by blists - more mailing lists