drivers: sensor: icm42605: Fix build issues

There are several different issues when trying to build the icm42605
sensor driver:

* Missing entry in drivers/sensor/CMakeLists.txt
* Issues with #ifndef in header files
* Issues with const usage
* Missing function prototypes in headers
* Fix use of LOG_MODULE_REGISTER v LOG_MODULE_DECLARE
* Add missing dts node to tests/drivers/build_all/spi.dtsi

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2021-02-09 21:58:34 -06:00 committed by Anas Nashif
commit 651898e13d
10 changed files with 38 additions and 18 deletions

View file

@ -74,10 +74,9 @@ static void icm42605_gpio_callback(const struct device *dev,
k_sem_give(&drv_data->gpio_sem);
}
static void icm42605_thread_cb(void *arg)
static void icm42605_thread_cb(const struct device *dev)
{
const struct device *dev = arg;
const struct icm42605_data *drv_data = dev->data;
struct icm42605_data *drv_data = dev->data;
const struct icm42605_config *cfg = dev->config;
if (drv_data->data_ready_handler != NULL) {
@ -97,7 +96,7 @@ static void icm42605_thread_cb(void *arg)
static void icm42605_thread(int dev_ptr, int unused)
{
const struct device *dev = INT_TO_POINTER(dev_ptr);
const struct icm42605_data *drv_data = dev->data;
struct icm42605_data *drv_data = dev->data;
ARG_UNUSED(unused);
@ -140,7 +139,7 @@ int icm42605_init_interrupt(const struct device *dev)
k_thread_create(&drv_data->thread, drv_data->thread_stack,
CONFIG_ICM42605_THREAD_STACK_SIZE,
(k_thread_entry_t)icm42605_thread, dev,
(k_thread_entry_t)icm42605_thread, drv_data,
0, NULL, K_PRIO_COOP(CONFIG_ICM42605_THREAD_PRIORITY),
0, K_NO_WAIT);