diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2024-06-06 16:26:46 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-06-13 19:19:24 +0100 |
commit | d7bffff19b6d5864b6322ab191ca3dfe6180673e (patch) | |
tree | c2b0571d8ac708cf1b587e84cc8f641eb7cb0835 /drivers | |
parent | bf3c855be8017fb339755fcb2fee80dac4071f41 (diff) |
iio: adc: ti-ads131e08: 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 <krzysztof.kozlowski@linaro.org>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240606-spi-match-data-v1-4-320b291ee1fe@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/adc/ti-ads131e08.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/iio/adc/ti-ads131e08.c b/drivers/iio/adc/ti-ads131e08.c index cb04a29b3dba..96dd9366f8ff 100644 --- a/drivers/iio/adc/ti-ads131e08.c +++ b/drivers/iio/adc/ti-ads131e08.c @@ -802,9 +802,7 @@ static int ads131e08_probe(struct spi_device *spi) unsigned long adc_clk_ns; int ret; - info = 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) { dev_err(&spi->dev, "failed to get match data\n"); return -ENODEV; |