drivers: sensors: Fix log module registration

All sensors were using legacy log module registeration method
where LOG_LEVEL was defined before registeration. This method
was error prone as it requires preserving includes order.

Replaced with LOG_MODULE_REGISTER(foo, level).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2019-10-11 12:40:57 +02:00 committed by Maureen Helm
commit ac417abdf0
99 changed files with 116 additions and 228 deletions

View file

@ -19,8 +19,7 @@
#include "lsm6dso.h"
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
LOG_MODULE_REGISTER(LSM6DSO);
LOG_MODULE_REGISTER(LSM6DSO, CONFIG_SENSOR_LOG_LEVEL);
static const u16_t lsm6dso_odr_map[] = {0, 12, 26, 52, 104, 208, 416, 833,
1660, 3330, 6660};

View file

@ -16,8 +16,7 @@
#ifdef DT_ST_LSM6DSO_BUS_I2C
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
LOG_MODULE_DECLARE(LSM6DSO);
LOG_MODULE_DECLARE(LSM6DSO, CONFIG_SENSOR_LOG_LEVEL);
static int lsm6dso_i2c_read(struct device *dev, u8_t reg_addr,
u8_t *value, u8_t len)

View file

@ -19,8 +19,7 @@
#include "lsm6dso.h"
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
LOG_MODULE_DECLARE(LSM6DSO);
LOG_MODULE_DECLARE(LSM6DSO, CONFIG_SENSOR_LOG_LEVEL);
#define LSM6DSO_SHUB_DATA_OUT 0x02

View file

@ -16,8 +16,7 @@
#define LSM6DSO_SPI_READ (1 << 7)
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
LOG_MODULE_DECLARE(LSM6DSO);
LOG_MODULE_DECLARE(LSM6DSO, CONFIG_SENSOR_LOG_LEVEL);
static int lsm6dso_spi_read(struct device *dev, u8_t reg_addr,
u8_t *value, u8_t len)

View file

@ -15,8 +15,7 @@
#include "lsm6dso.h"
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
LOG_MODULE_DECLARE(LSM6DSO);
LOG_MODULE_DECLARE(LSM6DSO, CONFIG_SENSOR_LOG_LEVEL);
#if defined(CONFIG_LSM6DSO_ENABLE_TEMP)
/**