drivers: sensor: Fix device instance const qualifier loss

It is necessary to wrap the device pointer into data.
Which was done already on most of them when global trigger is enabled.

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-07-09 09:13:48 +02:00 committed by Carles Cufí
commit d00d86972a
76 changed files with 350 additions and 546 deletions

View file

@ -77,16 +77,11 @@ static void adt7420_gpio_callback(const struct device *dev,
}
#if defined(CONFIG_ADT7420_TRIGGER_OWN_THREAD)
static void adt7420_thread(int dev_ptr, int unused)
static void adt7420_thread(struct adt7420_data *drv_data)
{
const struct device *dev = INT_TO_POINTER(dev_ptr);
struct adt7420_data *drv_data = dev->data;
ARG_UNUSED(unused);
while (true) {
k_sem_take(&drv_data->gpio_sem, K_FOREVER);
process_int(dev);
process_int(drv_data->dev);
}
}
@ -165,8 +160,8 @@ int adt7420_init_interrupt(const struct device *dev)
k_thread_create(&drv_data->thread, drv_data->thread_stack,
CONFIG_ADT7420_THREAD_STACK_SIZE,
(k_thread_entry_t)adt7420_thread, dev,
0, NULL, K_PRIO_COOP(CONFIG_ADT7420_THREAD_PRIORITY),
(k_thread_entry_t)adt7420_thread, drv_data,
NULL, NULL, K_PRIO_COOP(CONFIG_ADT7420_THREAD_PRIORITY),
0, K_NO_WAIT);
#elif defined(CONFIG_ADT7420_TRIGGER_GLOBAL_THREAD)
drv_data->work.handler = adt7420_work_cb;