Commit 2b961c51 authored by Chunyan Zhang's avatar Chunyan Zhang Committed by Mark Brown

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: default avatarChunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lore.kernel.org/r/20210824070212.2089255-2-zhang.lyra@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5dc349ec
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment