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

From: Shrikant

Date: Tue Jan 20 2026 - 11:00:04 EST


> > > > + 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);
}

Let me know your feedback on it.

Regards,
Shrikant