]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: temperature: ltc2983: make use of spi_get_device_match_data()
authorNuno Sa <nuno.sa@analog.com>
Thu, 22 Feb 2024 12:55:52 +0000 (13:55 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 28 Feb 2024 19:26:36 +0000 (19:26 +0000)
Use spi_get_device_match_data() as it simplifies the code. No functional
change intended...

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240222-ltc2983-misc-improv-v1-1-cf7d4457e98c@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/ltc2983.c

index fcb96c44d9540793d20084579ab597155f3a3764..acc631857e279c94f112ea99066573b3fc8e7cc2 100644 (file)
@@ -1614,9 +1614,7 @@ static int ltc2983_probe(struct spi_device *spi)
 
        st = iio_priv(indio_dev);
 
-       st->info = device_get_match_data(&spi->dev);
-       if (!st->info)
-               st->info = (void *)spi_get_device_id(spi)->driver_data;
+       st->info = spi_get_device_match_data(spi);
        if (!st->info)
                return -ENODEV;