sensors: lis2dh: move header after log module init

Allow logging in header file using the module of the file including the
header.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2018-10-16 08:14:54 -04:00
commit 1f6122e268
3 changed files with 2 additions and 7 deletions

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include "lis2dh.h"
#include <init.h>
#include <misc/byteorder.h>
@ -13,6 +12,7 @@
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
LOG_MODULE_REGISTER(lis2dh);
#include "lis2dh.h"
#if defined(CONFIG_LIS2DH_BUS_SPI)
int lis2dh_spi_access(struct lis2dh_data *ctx, u8_t cmd,

View file

@ -14,9 +14,7 @@
#include <gpio.h>
#include <sensor.h>
#include <string.h>
#include <logging/log.h>
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
#if defined(CONFIG_LIS2DH_BUS_SPI)
#include <spi.h>
@ -227,8 +225,6 @@ static inline int lis2dh_bus_configure(struct device *dev)
{
struct lis2dh_data *lis2dh = dev->driver_data;
LOG_MODULE_DECLARE(lis2dh);
#if defined(CONFIG_LIS2DH_BUS_SPI)
lis2dh->spi = device_get_binding(LIS2DH_BUS_DEV_NAME);
if (lis2dh->spi == NULL) {

View file

@ -4,8 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include "lis2dh.h"
#include <misc/util.h>
#include <kernel.h>
@ -17,6 +15,7 @@
#define LOG_LEVEL CONFIG_SENSOR_LOG_LEVEL
#include <logging/log.h>
LOG_MODULE_DECLARE(lis2dh);
#include "lis2dh.h"
static int lis2dh_trigger_drdy_set(struct device *dev, enum sensor_channel chan,
sensor_trigger_handler_t handler)