Re: [PATCH 1/6] iio: temperature: ltc2983: make use of spi_get_device_match_data()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 22 Feb 2024 13:55:52 +0100
Nuno Sa <nuno.sa@xxxxxxxxxx> wrote:

> Use spi_get_device_match_data() as it simplifies the code. No functional
> change intended...
> 
> Signed-off-by: Nuno Sa <nuno.sa@xxxxxxxxxx>
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;
>  
> 





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux