ibm_newemac: Fix dangerous struct assumption

The ibm_newemac driver includes code which assumes that the
work_struct which is included in every delayed_work is the first
member of that structure. This is currently the case but might change
in the future, so use to_delayed_work() instead, which doesn't make
such an assumption.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jean Delvare 2009-04-06 02:27:10 +00:00 committed by David S. Miller
parent c69c6d107a
commit 10fd9d7ec4
1 changed files with 1 additions and 1 deletions

View File

@ -1229,7 +1229,7 @@ static int emac_link_differs(struct emac_instance *dev)
static void emac_link_timer(struct work_struct *work)
{
struct emac_instance *dev =
container_of((struct delayed_work *)work,
container_of(to_delayed_work(work),
struct emac_instance, link_work);
int link_poll_interval;