Messages in this thread | | | Subject | Re: [PATCH 1/2] mux:adgs1408/1409: New driver for Analog Devices ADGS1408/1409 mux … | From | Peter Rosin <> | Date | Sat, 14 Jul 2018 21:51:49 +0200 |
| |
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
| |