summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/ti-tsc2046.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2024-06-06 16:26:47 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-06-13 20:19:24 +0200
commitd8f2d8ae94d1ad6c7c0f2db6e86a37a2e54bd23e (patch)
tree8b719eeff38ee41ecf77278c5926963b47f460b6 /drivers/iio/adc/ti-tsc2046.c
parentiio: adc: ti-ads131e08: simplify with spi_get_device_match_data() (diff)
downloadlinux-d8f2d8ae94d1ad6c7c0f2db6e86a37a2e54bd23e.tar.xz
linux-d8f2d8ae94d1ad6c7c0f2db6e86a37a2e54bd23e.zip
iio: adc: ti-tsc2046: 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-5-320b291ee1fe@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/ti-tsc2046.c')
-rw-r--r--drivers/iio/adc/ti-tsc2046.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
index 1bbb51a6683c..edcef8f11522 100644
--- a/drivers/iio/adc/ti-tsc2046.c
+++ b/drivers/iio/adc/ti-tsc2046.c
@@ -804,12 +804,7 @@ static int tsc2046_adc_probe(struct spi_device *spi)
return -EINVAL;
}
- dcfg = device_get_match_data(dev);
- if (!dcfg) {
- const struct spi_device_id *id = spi_get_device_id(spi);
-
- dcfg = (const struct tsc2046_adc_dcfg *)id->driver_data;
- }
+ dcfg = spi_get_device_match_data(spi);
if (!dcfg)
return -EINVAL;