diff options
author | james_chao <james_chao@asus.com> | 2016-05-06 21:28:53 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-06 15:01:44 -0700 |
commit | 1d8ff93a490e9a622e15111ca57c2c757fd0af45 (patch) | |
tree | 8b42df646cea710445fd4440953a1f213f25c8f8 /driver | |
parent | cd2ef5a5fa68136cf8e87ba14abe28253b26ca3b (diff) | |
download | chrome-ec-1d8ff93a490e9a622e15111ca57c2c757fd0af45.tar.gz |
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 <james_chao@asus.com>
Change-Id: I4d2bd200fc49892ae95c63aaeca3af75f7338bec
Reviewed-on: https://chromium-review.googlesource.com/342809
Commit-Ready: BoChao Jhan <james_chao@asus.com>
Tested-by: BoChao Jhan <james_chao@asus.com>
Reviewed-by: BoChao Jhan <james_chao@asus.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/accelgyro_bmi160.c | 2 |
1 files changed, 1 insertions, 1 deletions
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]", |