提交 d836cae4 编写于 作者: H Haavard Skinnemoen 提交者: Jeff Garzik

[PATCH] MACB: Use struct delayed_work instead of struct work_struct

The macb driver calls schedule_delayed_work() and friends, so we need
to use a struct delayed_work along with it. The conversion was
explained by David Howells on lkml Dec 5 2006:

http://lkml.org/lkml/2006/12/5/269Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 68dc44af
...@@ -267,9 +267,9 @@ static void macb_update_stats(struct macb *bp) ...@@ -267,9 +267,9 @@ static void macb_update_stats(struct macb *bp)
*p += readl(reg); *p += readl(reg);
} }
static void macb_periodic_task(void *arg) static void macb_periodic_task(struct work_struct *work)
{ {
struct macb *bp = arg; struct macb *bp = container_of(work, struct macb, periodic_task.work);
macb_update_stats(bp); macb_update_stats(bp);
macb_check_media(bp, 1, 0); macb_check_media(bp, 1, 0);
...@@ -1088,7 +1088,7 @@ static int __devinit macb_probe(struct platform_device *pdev) ...@@ -1088,7 +1088,7 @@ static int __devinit macb_probe(struct platform_device *pdev)
dev->base_addr = regs->start; dev->base_addr = regs->start;
INIT_WORK(&bp->periodic_task, macb_periodic_task, bp); INIT_DELAYED_WORK(&bp->periodic_task, macb_periodic_task);
mutex_init(&bp->mdio_mutex); mutex_init(&bp->mdio_mutex);
init_completion(&bp->mdio_complete); init_completion(&bp->mdio_complete);
......
...@@ -377,7 +377,7 @@ struct macb { ...@@ -377,7 +377,7 @@ struct macb {
unsigned int rx_pending, tx_pending; unsigned int rx_pending, tx_pending;
struct work_struct periodic_task; struct delayed_work periodic_task;
struct mutex mdio_mutex; struct mutex mdio_mutex;
struct completion mdio_complete; struct completion mdio_complete;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册