watchdog: hpwdt (12/12): Make NMI decoding a compile-time option
[firefly-linux-kernel-4.4.55.git] / drivers / mfd / ab8500-spi.c
index b81d4f768ef6ce410a78694118111075c9af38cd..e1c8b62b086d506ef46d8a52ccb6d5c4d73e0a18 100644 (file)
@@ -68,7 +68,12 @@ static int ab8500_spi_read(struct ab8500 *ab8500, u16 addr)
 
        ret = spi_sync(spi, &msg);
        if (!ret)
-               ret = ab8500->rx_buf[0];
+               /*
+                * Only the 8 lowermost bytes are
+                * defined with value, the rest may
+                * vary depending on chip/board noise.
+                */
+               ret = ab8500->rx_buf[0] & 0xFFU;
 
        return ret;
 }