From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Akshay Jindal <akshayaj.lkd@gmail.com>
Cc: anshulusr@gmail.com, jic23@kernel.org, dlechner@baylibre.com,
nuno.sa@analog.com, andy@kernel.org, shuah@kernel.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] iio: light: ltr390: Add device powerdown functionality via devm api
Date: Thu, 14 Aug 2025 00:43:03 +0300 [thread overview]
Message-ID: <aJ0G542k3K4jGrrw@smile.fi.intel.com> (raw)
In-Reply-To: <CAE3SzaSNV4DMUQB5rQQSV+QsCS6Z2BjFkFD3eaXO9J=TjUbNYw@mail.gmail.com>
On Wed, Aug 13, 2025 at 07:27:09PM +0530, Akshay Jindal wrote:
> On Wed, Aug 13, 2025 at 7:20 PM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > On Wed, Aug 13, 2025 at 07:00:14PM +0530, Akshay Jindal wrote:
...
> > > 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.
NULL is legit value for driver_data. The rule of thumb is that we don't assign
something that we know will never be used. Also think about debugging issues,
with the "legit" value in some pointer it may lead to not noticing a real
problem or to a problem that never exists if driver_data left untouched.
> Hence I kept it.
> If you feel otherwise, I can remove it, but I feel this should be kept.
I feel definitely otherwise.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-08-13 21:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 13:30 [PATCH v3] iio: light: ltr390: Add device powerdown functionality via devm api Akshay Jindal
2025-08-13 13:50 ` Andy Shevchenko
2025-08-13 13:57 ` Akshay Jindal
2025-08-13 21:43 ` Andy Shevchenko [this message]
2025-08-14 3:49 ` Akshay Jindal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aJ0G542k3K4jGrrw@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=akshayaj.lkd@gmail.com \
--cc=andy@kernel.org \
--cc=anshulusr@gmail.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.