lkml.org 
[lkml]   [2018]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] mux:adgs1408/1409: New driver for Analog Devices ADGS1408/1409 mux …
From
Date
On 2018-07-14 16:02, Lars-Peter Clausen wrote:
> On 07/14/2018 02:04 PM, Peter Rosin wrote:
> [...]
>>> +static int adgs140x_spi_reg_write(struct spi_device *spi,
>>> + u8 reg_addr, u8 reg_data)
>>> +{
>>> + u8 tx_buf[2];
>>> +
>>> + tx_buf[0] = reg_addr;
>>> + tx_buf[1] = reg_data;
>>> +
>>> + return spi_write_then_read(spi, tx_buf, sizeof(tx_buf), NULL, 0);
>>
>> return spi_write(spi, tx_buf, sizeof(tx_buf));
>
> Be aware spi_write_then_read() can handle on stack buffers, spi_write() can't.
>

How obvious...

But ok, I guess the ugliness is warranted.

Cheers,
Peter
\
 
 \ /
  Last update: 2018-07-15 22:07    [W:0.053 / U:7.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site