Re: [PATCH next] iio: sca3000: simplify with spi_get_device_match_data()

From: Andy Shevchenko

Date: Mon Feb 16 2026 - 05:04:05 EST


On Mon, Feb 16, 2026 at 01:51:05AM -0800, Harshit Mogalapalli wrote:
> 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.

--
With Best Regards,
Andy Shevchenko