Re: [PATCH v5 3/5] iio: proximity: rfd77402: Add interrupt handling support

From: Andy Shevchenko

Date: Tue Jan 20 2026 - 11:14:31 EST


On Tue, Jan 20, 2026 at 09:29:50PM +0530, Shrikant wrote:

...

> > > > > + i2c_set_clientdata(client, indio_dev);
> > > >
> > > > Is it used?
> > > Yes, it is used in rfd77402_init().
> >
> > Can it be passed directly?
> >
> > In other words, can we refactor code to get rid of the i2c_set_clientdata() and
> > respective getter calls?
> Yes, I can pass struct rfd77402_data *data as an argument to rfd77402_init() and
> then I can avoid the i2c_set_clientdata() and respective getter calls.
> But for that I
> also need to update the rfd77402_resume() as below:
>
> static int rfd77402_resume(struct device *dev)
> {
> struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct rfd77402_data *data = iio_priv(indio_dev);
>
> return rfd77402_init(data);
> }

Ah, this makes a lot of sense now. But leave this call only for the PM
callbacks. In other words, please change the parameter of rfd77402_init().

--
With Best Regards,
Andy Shevchenko