diff options
| author | Krzysztof Kozlowski <[email protected]> | 2024-06-06 16:26:45 +0200 |
|---|---|---|
| committer | Jonathan Cameron <[email protected]> | 2024-06-13 19:19:24 +0100 |
| commit | bf3c855be8017fb339755fcb2fee80dac4071f41 (patch) | |
| tree | 8819120825c38f3d8cb86138489be7e4e6a7ed84 | |
| parent | eafc2664be3adecf6a1902e4a58ac0719b62341c (diff) | |
iio: adc: max11205: simplify with spi_get_device_match_data()
Use spi_get_device_match_data() helper to simplify a bit the driver.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Nuno Sa <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
| -rw-r--r-- | drivers/iio/adc/max11205.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/adc/max11205.c b/drivers/iio/adc/max11205.c index 65fc32971ba5..9d8bc0b154dd 100644 --- a/drivers/iio/adc/max11205.c +++ b/drivers/iio/adc/max11205.c @@ -116,10 +116,7 @@ static int max11205_probe(struct spi_device *spi) ad_sd_init(&st->sd, indio_dev, spi, &max11205_sigma_delta_info); - st->chip_info = device_get_match_data(&spi->dev); - if (!st->chip_info) - st->chip_info = - (const struct max11205_chip_info *)spi_get_device_id(spi)->driver_data; + st->chip_info = spi_get_device_match_data(spi); indio_dev->name = st->chip_info->name; indio_dev->modes = INDIO_DIRECT_MODE; |