Message ID | 20240222-ltc2983-misc-improv-v1-1-cf7d4457e98c@analog.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | iio: temperature: ltc2983: small improvements | expand |
On Thu, 22 Feb 2024 13:55:52 +0100 Nuno Sa <nuno.sa@analog.com> wrote: > Use spi_get_device_match_data() as it simplifies the code. No functional > change intended... > > Signed-off-by: Nuno Sa <nuno.sa@analog.com> I'm a sucker for cleanup patches. Applied > --- > drivers/iio/temperature/ltc2983.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c > index fcb96c44d954..acc631857e27 100644 > --- a/drivers/iio/temperature/ltc2983.c > +++ b/drivers/iio/temperature/ltc2983.c > @@ -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; > >
diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index fcb96c44d954..acc631857e27 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -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;
Use spi_get_device_match_data() as it simplifies the code. No functional change intended... Signed-off-by: Nuno Sa <nuno.sa@analog.com> --- drivers/iio/temperature/ltc2983.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)