From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Andrew Ijano" <andrew.ijano@gmail.com>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH next] iio: sca3000: simplify with spi_get_device_match_data()
Date: Tue, 17 Feb 2026 09:49:13 +0200 [thread overview]
Message-ID: <aZQdeejX3ntHFWdM@smile.fi.intel.com> (raw)
In-Reply-To: <74d31a2c-d515-46d2-90f0-46ff816ee3a0@oracle.com>
On Mon, Feb 16, 2026 at 03:45:34PM +0530, Harshit Mogalapalli wrote:
> On 16/02/26 15:33, Andy Shevchenko wrote:
> > On Mon, Feb 16, 2026 at 01:51:05AM -0800, Harshit Mogalapalli wrote:
...
> > > - st->info = &sca3000_spi_chip_info_tbl[spi_get_device_id(spi)
> > > - ->driver_data];
> > > + st->info = spi_get_device_match_data(spi);
> >
> > > + if (!st->info)
> > > + return -EINVAL;
> >
> > This is a dead check. Just make it a requirement and drop dead code.
> > The support of a new HW will be assumed not tested at all if there
> > is no driver_data.
>
> I agree, will drop the check in V2.
>
> There are a few commits like this which added NULL checks, so I was not
> fully sure.
>
> commit: c5d8facf107a ("iio: adc: ad7192: properly check
> spi_get_device_match_data()")
Nice catch!
That change is unneeded churn that adds a dead code as it looks like.
Nuno, can you elaborate the motivation behind that?
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-02-17 7:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 9:51 [PATCH next] iio: sca3000: simplify with spi_get_device_match_data() Harshit Mogalapalli
2026-02-16 10:03 ` Andy Shevchenko
2026-02-16 10:15 ` Harshit Mogalapalli
2026-02-17 7:49 ` Andy Shevchenko [this message]
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=aZQdeejX3ntHFWdM@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=andrew.ijano@gmail.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=dlechner@baylibre.com \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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.