linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chunyan Zhang <zhang.lyra@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, Baolin Wang <baolin.wang7@gmail.com>,
	Orson Zhai <orsonzhai@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Chunyan Zhang <chunyan.zhang@unisoc.com>,
	Luting Guo <luting.guo@unisoc.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/3] spi: sprd: Make sure offset not equal to slave address size
Date: Tue, 24 Aug 2021 15:02:11 +0800	[thread overview]
Message-ID: <20210824070212.2089255-2-zhang.lyra@gmail.com> (raw)
In-Reply-To: <20210824070212.2089255-1-zhang.lyra@gmail.com>

From: Chunyan Zhang <chunyan.zhang@unisoc.com>

The slave register offset shouldn't equal to the max slave address
which ADI can support to access.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 drivers/spi/spi-sprd-adi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
index abdad1ea7b38..06af519c0b21 100644
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -119,7 +119,7 @@ struct sprd_adi {
 
 static int sprd_adi_check_addr(struct sprd_adi *sadi, u32 reg)
 {
-	if (reg > ADI_SLAVE_ADDR_SIZE) {
+	if (reg >= ADI_SLAVE_ADDR_SIZE) {
 		dev_err(sadi->dev,
 			"slave address offset is incorrect, reg = 0x%x\n",
 			reg);
-- 
2.25.1


  reply	other threads:[~2021-08-24  7:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24  7:02 [PATCH 1/3] spi: sprd: Pass offset instead of physical address to adi_read/_write() Chunyan Zhang
2021-08-24  7:02 ` Chunyan Zhang [this message]
2021-08-24  7:02 ` [PATCH 3/3] spi: sprd: fill offset only to RD_CMD register for reading from slave device Chunyan Zhang
2021-08-25 10:22 ` [PATCH 1/3] spi: sprd: Pass offset instead of physical address to adi_read/_write() Mark Brown

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=20210824070212.2089255-2-zhang.lyra@gmail.com \
    --to=zhang.lyra@gmail.com \
    --cc=baolin.wang7@gmail.com \
    --cc=broonie@kernel.org \
    --cc=chunyan.zhang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=luting.guo@unisoc.com \
    --cc=orsonzhai@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).