summaryrefslogtreecommitdiff
path: root/driver/baro_bmp280.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2017-11-13 12:33:24 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-17 20:18:30 -0800
commitf587852570770564e8a94b2c3f7ad7d97883c49a (patch)
treea7d78650875c700c3449268ed05330a11bea5eb6 /driver/baro_bmp280.c
parentab2ce0a0ef38a701a9cc6622ccb41ba55d6b4984 (diff)
downloadchrome-ec-f587852570770564e8a94b2c3f7ad7d97883c49a.tar.gz
motion_sense: Put set_range in common code
At the end of the sensor initialization, all _init sensor routines set the range to the default value from board.c file. Put all the code in a single place, move it from sensor_common.c to motion_sense.c. BUG=none BRANCH=none TEST=compile Change-Id: If89cf27c6438e0f215c193d68a480e027110174c Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/767610 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/baro_bmp280.c')
-rw-r--r--driver/baro_bmp280.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/driver/baro_bmp280.c b/driver/baro_bmp280.c
index 2e939ceac3..3ca0084704 100644
--- a/driver/baro_bmp280.c
+++ b/driver/baro_bmp280.c
@@ -322,9 +322,12 @@ static int bmp280_init(const struct motion_sensor_t *s)
if (ret)
return ret;
- bmp280_set_range(s, s->default_range, 0);
/* Read bmp280 calibration parameter */
- return bmp280_get_calib_param(s);
+ ret = bmp280_get_calib_param(s);
+ if (ret)
+ return ret;
+
+ return sensor_init_done(s);
}
static int bmp280_read(const struct motion_sensor_t *s, vector_3_t v)