Re: [PATCH v1 04/16] iio: dac: ltc2632: Use put_unaligned_be24()

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

 



On Tue, 21 Apr 2020 03:31:23 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> This makes the driver code slightly easier to read.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Applied with same include fix.

Jonathan

> ---
>  drivers/iio/dac/ltc2632.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
> index 7adc91056aa1..5123776cb63e 100644
> --- a/drivers/iio/dac/ltc2632.c
> +++ b/drivers/iio/dac/ltc2632.c
> @@ -75,9 +75,7 @@ static int ltc2632_spi_write(struct spi_device *spi,
>  	 * 10-, 8-bit input code followed by 4, 6, or 8 don't care bits.
>  	 */
>  	data = (cmd << 20) | (addr << 16) | (val << shift);
> -	msg[0] = data >> 16;
> -	msg[1] = data >> 8;
> -	msg[2] = data;
> +	put_unaligned_be24(data, &msg[0]);
>  
>  	return spi_write(spi, msg, sizeof(msg));
>  }




[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