-/* $OpenBSD: drm_linux.c,v 1.77 2021/02/08 08:18:45 mpi Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.78 2021/02/14 03:42:55 jsg Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
if (cold)
return;
- taskq_barrier((struct taskq *)wq);
+ if (wq)
+ taskq_barrier((struct taskq *)wq);
}
bool
if (cold)
return false;
- taskq_barrier(work->tq);
+ if (work->tq)
+ taskq_barrier(work->tq);
return false;
}
ret = true;
}
- taskq_barrier(dwork->tq ? dwork->tq : (struct taskq *)system_wq);
+ if (dwork->tq)
+ taskq_barrier(dwork->tq);
return ret;
}
-/* $OpenBSD: workqueue.h,v 1.3 2020/06/08 04:48:15 jsg Exp $ */
+/* $OpenBSD: workqueue.h,v 1.4 2021/02/14 03:42:55 jsg Exp $ */
/*
* Copyright (c) 2015 Mark Kettenis
*
static inline void
INIT_WORK(struct work_struct *work, work_func_t func)
{
- work->tq = (struct taskq *)system_wq;
+ work->tq = NULL;
task_set(&work->task, (void (*)(void *))func, work);
}
static inline bool
schedule_work(struct work_struct *work)
{
+ work->tq = (struct taskq *)system_wq;
return task_add(work->tq, &work->task);
}