]> err.no Git - linux-2.6/commitdiff
[PATCH] MACB: Use struct delayed_work instead of struct work_struct
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Fri, 8 Dec 2006 13:37:35 +0000 (14:37 +0100)
committerJeff Garzik <jeff@garzik.org>
Mon, 11 Dec 2006 14:31:28 +0000 (09:31 -0500)
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/269

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/macb.c
drivers/net/macb.h

index bd0ce98c939cac1c5da1539df365866cb552c773..3496d19c55e184486608d730f300930682469a01 100644 (file)
@@ -267,9 +267,9 @@ static void macb_update_stats(struct macb *bp)
                *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_check_media(bp, 1, 0);
@@ -1088,7 +1088,7 @@ static int __devinit macb_probe(struct platform_device *pdev)
 
        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);
        init_completion(&bp->mdio_complete);
 
index 8c253db69881d9afc1c420c5152487fbf384c82a..e3fcb2e06fdc3f29151284d9f5c5441e2c03152e 100644 (file)
@@ -377,7 +377,7 @@ struct macb {
 
        unsigned int            rx_pending, tx_pending;
 
-       struct work_struct      periodic_task;
+       struct delayed_work     periodic_task;
 
        struct mutex            mdio_mutex;
        struct completion       mdio_complete;