summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChunyan Zhang <chunyan.zhang@unisoc.com>2021-08-24 10:02:11 +0300
committerMark Brown <broonie@kernel.org>2021-08-24 21:15:05 +0300
commit2b961c51f4d35c45116b21936b563cbb78fba540 (patch)
treea411b2c10e24a2cfc18869e90d5000a6e2400ee9 /drivers
parent5dc349ec131c6d40aeb2545064e285f0025fbb39 (diff)
downloadlinux-2b961c51f4d35c45116b21936b563cbb78fba540.tar.xz
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 <chunyan.zhang@unisoc.com> Link: https://lore.kernel.org/r/20210824070212.2089255-2-zhang.lyra@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-sprd-adi.c2
1 files changed, 1 insertions, 1 deletions
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);