[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE3SzaSNV4DMUQB5rQQSV+QsCS6Z2BjFkFD3eaXO9J=TjUbNYw@mail.gmail.com>
Date: Wed, 13 Aug 2025 19:27:09 +0530
From: Akshay Jindal <akshayaj.lkd@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...el.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 v3] iio: light: ltr390: Add device powerdown functionality
via devm api
On Wed, Aug 13, 2025 at 7:20 PM Andy Shevchenko
<andriy.shevchenko@...el.com> wrote:
>
> On Wed, Aug 13, 2025 at 07:00:14PM +0530, Akshay Jindal wrote:
> > Use devm_add_action_or_reset() to do cleanup when the device is removed.
>
> > Set client data with i2c_set_clientdata().
>
> This is not used anymore, correct?
>
> ...
>
> > - data = iio_priv(indio_dev);
> > + i2c_set_clientdata(client, indio_dev);
> >
> > + data = iio_priv(indio_dev);
> > data->regmap = devm_regmap_init_i2c(client, <r390_regmap_config);
> > if (IS_ERR(data->regmap))
> > return dev_err_probe(dev, PTR_ERR(data->regmap),
>
> So this hunk needs to be removed from the patch.
I thought so, but removing i2c_set_clientdata would mean that
dev->driver_data will NOT contain a pointer to indio_dev.
Irrespective of usage, ideally dev->driver_data should contain legit value.
Hence I kept it.
If you feel otherwise, I can remove it, but I feel this should be kept.
Thanks,
Akshay
Powered by blists - more mailing lists