input:misc: fix bmp280 not getting events issue
Xiaohui Tao [Fri, 14 Jun 2013 00:12:12 +0000 (17:12 -0700)]
Bmp280 is not getting pressure events. We found a bug inside driver
that is checking the wrong value for value reading.

Change-Id: I7f95be393690e6d8e9cee0b5aef23a8298b97b3d
Signed-off-by: Xiaohui Tao <xtao@nvidia.com>
Reviewed-on: http://git-master/r/243011
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Tested-by: Seema Khowala <seemaj@nvidia.com>

drivers/input/misc/pressure/bmp180.c

index 5c40f8d..75911f8 100644 (file)
@@ -864,7 +864,7 @@ static int bmp280_read(struct bmp_inf *inf)
        if (err)
                return err;
 
-       err = bmp180_read_sts(inf, data);
+       err = bmp280_read_sts(inf, data);
        if (err > 0) {
                timestamp2 = (timestamp2 - timestamp1) >> 1;
                timestamp1 += timestamp2;
@@ -882,7 +882,7 @@ static void bmp280_mpu_handler(u8 *data, unsigned int len, s64 ts, void *p_val)
        inf = (struct bmp_inf *)p_val;
        if (inf->enable) {
                err = bmp280_read_sts(inf, data);
-               if (!err)
+               if (err > 0)
                        bmp_report(inf, ts);
        }
 }