[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210824070212.2089255-2-zhang.lyra@gmail.com>
Date: Tue, 24 Aug 2021 15:02:11 +0800
From: Chunyan Zhang <zhang.lyra@...il.com>
To: Mark Brown <broonie@...nel.org>
Cc: linux-spi@...r.kernel.org, Baolin Wang <baolin.wang7@...il.com>,
Orson Zhai <orsonzhai@...il.com>,
Chunyan Zhang <zhang.lyra@...il.com>,
Chunyan Zhang <chunyan.zhang@...soc.com>,
Luting Guo <luting.guo@...soc.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/3] spi: sprd: Make sure offset not equal to slave address size
From: Chunyan Zhang <chunyan.zhang@...soc.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@...soc.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
Powered by blists - more mailing lists