[PATCH] misc: lis3lv02d: use spi_write_then_read() instead of spi_write()

From: Marcus Folkesson
Date: Fri Dec 09 2016 - 05:43:54 EST


spi_write() needs a DMA-safe buffer.

Signed-off-by: Marcus Folkesson <marcus.folkesson@xxxxxxxxx>
---
drivers/misc/lis3lv02d/lis3lv02d_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
index e575475123c8..7e592df6f0d2 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c
@@ -40,7 +40,7 @@ static int lis3_spi_write(struct lis3lv02d *lis3, int reg, u8 val)
{
u8 tmp[2] = { reg, val };
struct spi_device *spi = lis3->bus_priv;
- return spi_write(spi, tmp, sizeof(tmp));
+ return spi_write_then_read(spi, tmp, sizeof(tmp), NULL, 0);
}

static int lis3_spi_init(struct lis3lv02d *lis3)
--
2.11.0.rc2