mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-07 13:53:24 +00:00
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>
This commit is contained in:
parent
d7bffff19b
commit
d8f2d8ae94
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user