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.