diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2024-06-06 17:26:50 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-06-13 21:19:24 +0300 |
commit | bf977499c10667deb38f85dd4d0f287b0133ab54 (patch) | |
tree | 2cbb6dbcfedef75a6b7c5c0c2a22e587c13265cf /drivers/iio/adc | |
parent | 2ac3ce8afd5f2d3bc0271e76e4d005d62594090e (diff) | |
download | linux-bf977499c10667deb38f85dd4d0f287b0133ab54.tar.xz |
iio: adc: mcp3564: drop redundant open-coded spi_get_device_match_data()
The driver calls spi_get_device_match_data() and on its failure calls
again parts of it: spi_get_device_id() and getting driver data. This is
entirely redundant, because it is part of spi_get_device_match_data().
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-8-320b291ee1fe@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/mcp3564.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/iio/adc/mcp3564.c b/drivers/iio/adc/mcp3564.c index e2ae13f1e842..d83bed0e63d2 100644 --- a/drivers/iio/adc/mcp3564.c +++ b/drivers/iio/adc/mcp3564.c @@ -1114,7 +1114,6 @@ static int mcp3564_config(struct iio_dev *indio_dev) { struct mcp3564_state *adc = iio_priv(indio_dev); struct device *dev = &adc->spi->dev; - const struct spi_device_id *dev_id; u8 tmp_reg; u16 tmp_u16; enum mcp3564_ids ids; @@ -1212,11 +1211,6 @@ static int mcp3564_config(struct iio_dev *indio_dev) * try using fallback compatible in device tree to deal with some newer part number. */ adc->chip_info = spi_get_device_match_data(adc->spi); - if (!adc->chip_info) { - dev_id = spi_get_device_id(adc->spi); - adc->chip_info = (const struct mcp3564_chip_info *)dev_id->driver_data; - } - adc->have_vref = adc->chip_info->have_vref; } else { adc->chip_info = &mcp3564_chip_infos_tbl[ids]; |