diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-04-02 19:56:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 22:04:50 -0400 |
commit | bf6aede712334d7338d5c47a5ee5ba3883c82a61 (patch) | |
tree | 153483c5ef1de41f8dd3d233ba46117d0676c303 /drivers/net | |
parent | e4c2ff1cf2d7fc65d0fc6f88bc98338e0212ad52 (diff) |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/dm9000.c | 2 | ||||
-rw-r--r-- | drivers/net/mlx4/en_netdev.c | 2 | ||||
-rw-r--r-- | drivers/net/mlx4/en_rx.c | 2 | ||||
-rw-r--r-- | drivers/net/mlx4/sense.c | 2 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 3 |
5 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 254ec62b5f58..d8350860c0f8 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -559,7 +559,7 @@ static void dm9000_show_carrier(board_info_t *db, | |||
559 | static void | 559 | static void |
560 | dm9000_poll_work(struct work_struct *w) | 560 | dm9000_poll_work(struct work_struct *w) |
561 | { | 561 | { |
562 | struct delayed_work *dw = container_of(w, struct delayed_work, work); | 562 | struct delayed_work *dw = to_delayed_work(w); |
563 | board_info_t *db = container_of(dw, board_info_t, phy_poll); | 563 | board_info_t *db = container_of(dw, board_info_t, phy_poll); |
564 | struct net_device *ndev = db->ndev; | 564 | struct net_device *ndev = db->ndev; |
565 | 565 | ||
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index 9f6644a44030..303c23de6cac 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c | |||
@@ -505,7 +505,7 @@ out: | |||
505 | 505 | ||
506 | static void mlx4_en_do_get_stats(struct work_struct *work) | 506 | static void mlx4_en_do_get_stats(struct work_struct *work) |
507 | { | 507 | { |
508 | struct delayed_work *delay = container_of(work, struct delayed_work, work); | 508 | struct delayed_work *delay = to_delayed_work(work); |
509 | struct mlx4_en_priv *priv = container_of(delay, struct mlx4_en_priv, | 509 | struct mlx4_en_priv *priv = container_of(delay, struct mlx4_en_priv, |
510 | stats_task); | 510 | stats_task); |
511 | struct mlx4_en_dev *mdev = priv->mdev; | 511 | struct mlx4_en_dev *mdev = priv->mdev; |
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c index a4130e764991..7e40741fb7d8 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
@@ -298,7 +298,7 @@ static void mlx4_en_free_rx_buf(struct mlx4_en_priv *priv, | |||
298 | 298 | ||
299 | void mlx4_en_rx_refill(struct work_struct *work) | 299 | void mlx4_en_rx_refill(struct work_struct *work) |
300 | { | 300 | { |
301 | struct delayed_work *delay = container_of(work, struct delayed_work, work); | 301 | struct delayed_work *delay = to_delayed_work(work); |
302 | struct mlx4_en_priv *priv = container_of(delay, struct mlx4_en_priv, | 302 | struct mlx4_en_priv *priv = container_of(delay, struct mlx4_en_priv, |
303 | refill_task); | 303 | refill_task); |
304 | struct mlx4_en_dev *mdev = priv->mdev; | 304 | struct mlx4_en_dev *mdev = priv->mdev; |
diff --git a/drivers/net/mlx4/sense.c b/drivers/net/mlx4/sense.c index 6d5089ecb5af..f36ae691cab3 100644 --- a/drivers/net/mlx4/sense.c +++ b/drivers/net/mlx4/sense.c | |||
@@ -103,7 +103,7 @@ void mlx4_do_sense_ports(struct mlx4_dev *dev, | |||
103 | 103 | ||
104 | static void mlx4_sense_port(struct work_struct *work) | 104 | static void mlx4_sense_port(struct work_struct *work) |
105 | { | 105 | { |
106 | struct delayed_work *delay = container_of(work, struct delayed_work, work); | 106 | struct delayed_work *delay = to_delayed_work(work); |
107 | struct mlx4_sense *sense = container_of(delay, struct mlx4_sense, | 107 | struct mlx4_sense *sense = container_of(delay, struct mlx4_sense, |
108 | sense_poll); | 108 | sense_poll); |
109 | struct mlx4_dev *dev = sense->dev; | 109 | struct mlx4_dev *dev = sense->dev; |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 58b73b08dde0..3ff1f425f1bb 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -757,8 +757,7 @@ EXPORT_SYMBOL(phy_start); | |||
757 | */ | 757 | */ |
758 | static void phy_state_machine(struct work_struct *work) | 758 | static void phy_state_machine(struct work_struct *work) |
759 | { | 759 | { |
760 | struct delayed_work *dwork = | 760 | struct delayed_work *dwork = to_delayed_work(work); |
761 | container_of(work, struct delayed_work, work); | ||
762 | struct phy_device *phydev = | 761 | struct phy_device *phydev = |
763 | container_of(dwork, struct phy_device, state_queue); | 762 | container_of(dwork, struct phy_device, state_queue); |
764 | int needs_aneg = 0; | 763 | int needs_aneg = 0; |