Skip to content

Commit 2b961c5

Browse files
Chunyan Zhangbroonie
authored andcommitted
spi: sprd: Make sure offset not equal to slave address size
The slave register offset shouldn't equal to the max slave address which ADI can support to access. Signed-off-by: Chunyan Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5dc349e commit 2b961c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-sprd-adi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct sprd_adi {
119119

120120
static int sprd_adi_check_addr(struct sprd_adi *sadi, u32 reg)
121121
{
122-
if (reg > ADI_SLAVE_ADDR_SIZE) {
122+
if (reg >= ADI_SLAVE_ADDR_SIZE) {
123123
dev_err(sadi->dev,
124124
"slave address offset is incorrect, reg = 0x%x\n",
125125
reg);

0 commit comments

Comments
 (0)