nano_work: Add nano_work_init
Change-Id: I2e54e3e6ad048ff0d85cbef83e415ad436ecf720 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
b7a72220ea
commit
21fabb3d39
|
@ -53,6 +53,15 @@ struct nano_work {
|
|||
work_handler_t handler;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Initialize work item
|
||||
*/
|
||||
static inline void nano_work_init(struct nano_work *work,
|
||||
work_handler_t handler)
|
||||
{
|
||||
work->handler = handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Submit a work item to a workqueue.
|
||||
*/
|
||||
|
|
|
@ -62,7 +62,7 @@ static void test_items_init(void)
|
|||
|
||||
for (i = 0; i < NUM_TEST_ITEMS; i++) {
|
||||
tests[i].key = i + 1;
|
||||
tests[i].work.handler = work_handler;
|
||||
nano_work_init(&tests[i].work, work_handler);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue