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:
parent
6c34983ed2
commit
ac417abdf0
99 changed files with 116 additions and 228 deletions
|
@ -18,8 +18,7 @@
|
|||
|
||||
#include "lsm9ds0_gyro.h"
|
||||
|
||||
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
|
||||
LOG_MODULE_REGISTER(LSM9DS0_GYRO);
|
||||
LOG_MODULE_REGISTER(LSM9DS0_GYRO, CONFIG_SENSOR_LOG_LEVEL);
|
||||
|
||||
static inline int lsm9ds0_gyro_power_ctrl(struct device *dev, int power,
|
||||
int x_en, int y_en, int z_en)
|
||||
|
|
|
@ -11,16 +11,14 @@
|
|||
#include <drivers/i2c.h>
|
||||
#include <sys/byteorder.h>
|
||||
#include <sys/__assert.h>
|
||||
|
||||
#include <logging/log.h>
|
||||
#include <drivers/gpio.h>
|
||||
|
||||
#include "lsm9ds0_gyro.h"
|
||||
|
||||
extern struct lsm9ds0_gyro_data lsm9ds0_gyro_data;
|
||||
|
||||
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(LSM9DS0_GYRO);
|
||||
LOG_MODULE_DECLARE(LSM9DS0_GYRO, CONFIG_SENSOR_LOG_LEVEL);
|
||||
|
||||
int lsm9ds0_gyro_trigger_set(struct device *dev,
|
||||
const struct sensor_trigger *trig,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue