public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: Eric Piel <eric.piel@tremplin-utc.net>
Cc: linux-kernel@vger.kernel.org,
	Marcus Folkesson <marcus.folkesson@gmail.com>
Subject: [PATCH] misc: lis3lv02d: use spi_write_then_read() instead of spi_write()
Date: Fri,  9 Dec 2016 11:37:33 +0100	[thread overview]
Message-ID: <20161209103733.31226-1-marcus.folkesson@gmail.com> (raw)

spi_write() needs a DMA-safe buffer.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 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

                 reply	other threads:[~2016-12-09 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161209103733.31226-1-marcus.folkesson@gmail.com \
    --to=marcus.folkesson@gmail.com \
    --cc=eric.piel@tremplin-utc.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox