fix: Proper use of CONTAINER_OF with delayable work.
This commit is contained in:
parent
94aa7d8d53
commit
f4e6d70465
6 changed files with 13 additions and 6 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/kscan.h>
|
||||
#include <zephyr/drivers/gpio.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
|
|
@ -105,7 +106,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
|||
} \
|
||||
\
|
||||
static void kscan_gpio_work_handler_##n(struct k_work *work) { \
|
||||
struct kscan_gpio_data_##n *data = CONTAINER_OF(work, struct kscan_gpio_data_##n, work); \
|
||||
struct k_work_delayable *d_work = k_work_delayable_from_work(work); \
|
||||
struct kscan_gpio_data_##n *data = CONTAINER_OF(d_work, struct kscan_gpio_data_##n, work); \
|
||||
kscan_gpio_read_##n(data->dev); \
|
||||
} \
|
||||
\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue