spi: sprd: Make sure offset not equal to slave address size
[linux-2.6-microblaze.git] / drivers / spi / spi-sprd-adi.c
index abdad1e..06af519 100644 (file)
@@ -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);