kernel: workq: Fix type errors in delayable work handlers
A common pattern here was to take the work item as the subfield of a containing object. But the contained field is not a k_work, it's a k_work_delayable. Things were working only because the work field was first, so the pointers had the same value. Do things right and fix things to produce correct code if/when that field ever moves within delayable. Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
parent
6964f2b130
commit
731241f8d0
27 changed files with 72 additions and 36 deletions
|
@ -169,7 +169,8 @@ static int onoff_post_write_cb(uint16_t obj_inst_id,
|
|||
|
||||
static void buzzer_work_cb(struct k_work *work)
|
||||
{
|
||||
struct ipso_buzzer_data *buzzer = CONTAINER_OF(work,
|
||||
struct k_work_delayable *dwork = k_work_delayable_from_work(work);
|
||||
struct ipso_buzzer_data *buzzer = CONTAINER_OF(dwork,
|
||||
struct ipso_buzzer_data,
|
||||
buzzer_work);
|
||||
stop_buzzer(buzzer, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue