iio: adc: ad9467: use spi_get_device_match_data()

[ Upstream commit b67cc85d45d5d2894d0e2812bba27d7b23befbe6 ]

Make use of spi_get_device_match_data() to simplify things.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20231207-iio-backend-prep-v2-5-a4a33bc4d70e@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Stable-dep-of: cf1c833f89e7 ("iio: adc: adi-axi-adc: only error out in major version mismatch")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Nuno Sa 2023-12-07 13:39:28 +01:00 committed by Greg Kroah-Hartman
parent 08f5bd2032
commit a679a40bd2
1 changed files with 1 additions and 3 deletions

View File

@ -454,9 +454,7 @@ static int ad9467_probe(struct spi_device *spi)
unsigned int id;
int ret;
info = of_device_get_match_data(&spi->dev);
if (!info)
info = (void *)spi_get_device_id(spi)->driver_data;
info = spi_get_device_match_data(spi);
if (!info)
return -ENODEV;