Re: [PATCH next] iio: sca3000: simplify with spi_get_device_match_data()
From: Harshit Mogalapalli
Date: Mon Feb 16 2026 - 05:16:03 EST
Hi Andy,
On 16/02/26 15:33, Andy Shevchenko wrote:
On Mon, Feb 16, 2026 at 01:51:05AM -0800, Harshit Mogalapalli wrote:Thanks for the review!
Refactor each sca3000 variant with it's own chip_info struct, update the
sca3000_probe() to use spi_get_device_match_data().
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
...
- 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()")
Thanks,
Harshit