From 1d8ff93a490e9a622e15111ca57c2c757fd0af45 Mon Sep 17 00:00:00 2001 From: james_chao Date: Fri, 6 May 2016 21:28:53 +0800 Subject: driver/accelgyro_bmi160.c: fix the error handle in read() The function raw_read_n() return the status, and then check it it should be saved to the variable ret. BUG=none BRANCH=tot TEST=make buildall -j Signed-off-by: james_chao Change-Id: I4d2bd200fc49892ae95c63aaeca3af75f7338bec Reviewed-on: https://chromium-review.googlesource.com/342809 Commit-Ready: BoChao Jhan Tested-by: BoChao Jhan Reviewed-by: BoChao Jhan Reviewed-by: Duncan Laurie --- driver/accelgyro_bmi160.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/accelgyro_bmi160.c b/driver/accelgyro_bmi160.c index 0cc192aec2..bcdfb6a0ef 100644 --- a/driver/accelgyro_bmi160.c +++ b/driver/accelgyro_bmi160.c @@ -1072,7 +1072,7 @@ static int read(const struct motion_sensor_t *s, vector_3_t v) } /* Read 6 bytes starting at xyz_reg */ - raw_read_n(s->port, s->addr, get_xyz_reg(s->type), data, 6); + ret = raw_read_n(s->port, s->addr, get_xyz_reg(s->type), data, 6); if (ret != EC_SUCCESS) { CPRINTF("[%T %s type:0x%X RD XYZ Error %d]", -- cgit v1.2.1