Thread (4 messages) 4 messages, 2 authors, 2021-08-25

[PATCH 2/3] spi: sprd: Make sure offset not equal to slave address size

flat view
STALE1882d LANDED

From: Chunyan Zhang <zhang.lyra@gmail.com>
Date: 2021-08-24 07:02:35
Also in: lkml
Subsystem: spi subsystem, the rest · Maintainers: Mark Brown, Linus Torvalds

Landed in mainline as 2b961c51f4d3 on 2021-08-24.

From: Chunyan Zhang <redacted>

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

Signed-off-by: Chunyan Zhang <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help