workqueue: add to_delayed_work() helper function
It is a fairly common operation to have a pointer to a work and to need a pointer to the delayed work it is contained in. In particular, all delayed works which want to rearm themselves will have to do that. So it would seem fair to offer a helper function for this operation. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Greg KH <greg@kroah.com> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
e4c2ff1cf2
commit
bf6aede712
@@ -381,7 +381,7 @@ static void hgpk_disconnect(struct psmouse *psmouse)
|
||||
|
||||
static void hgpk_recalib_work(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *w = container_of(work, struct delayed_work, work);
|
||||
struct delayed_work *w = to_delayed_work(work);
|
||||
struct hgpk_data *priv = container_of(w, struct hgpk_data, recalib_wq);
|
||||
struct psmouse *psmouse = priv->psmouse;
|
||||
|
||||
|
Reference in New Issue
Block a user