[PATCH] fix work queues in FEC driver

From: Greg Ungerer
Date: Mon Jul 30 2007 - 02:30:43 EST


Fix the work queue code in the FEC driver.

Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxx>
---

diff -Naur linux-2.6.23-rc1-git2/drivers/net/fec.c linux/drivers/net/fec.c
--- linux-2.6.23-rc1-git2/drivers/net/fec.c 2007-07-26 10:46:14.000000000 +1000
+++ linux/drivers/net/fec.c 2007-07-26 23:09:23.000000000 +1000
@@ -191,6 +190,8 @@
/* Hardware registers of the FEC device */
volatile fec_t *hwp;

+ struct net_device *netdev;
+
/* The saved address of a sent-in-place packet/buffer, for skfree(). */
unsigned char *tx_bounce[TX_RING_SIZE];
struct sk_buff* tx_skbuff[TX_RING_SIZE];
@@ -1940,9 +1964,10 @@
printk(".\n");
}

-static void mii_display_config(struct net_device *dev)
+static void mii_display_config(struct work_struct *work)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task);
+ struct net_device *dev = fep->netdev;
uint status = fep->phy_status;

/*
@@ -1976,9 +2001,10 @@
fep->sequence_done = 1;
}

-static void mii_relink(struct net_device *dev)
+static void mii_relink(struct work_struct *work)
{
- struct fec_enet_private *fep = netdev_priv(dev);
+ struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task);
+ struct net_device *dev = fep->netdev;
int duplex;

/*
@@ -2022,7 +2048,7 @@
return;

fep->mii_phy_task_queued = 1;
- INIT_WORK(&fep->phy_task, (void*)mii_relink, dev);
+ INIT_WORK(&fep->phy_task, mii_relink);
schedule_work(&fep->phy_task);
}

@@ -2035,7 +2061,7 @@
return;

fep->mii_phy_task_queued = 1;
- INIT_WORK(&fep->phy_task, (void*)mii_display_config, dev);
+ INIT_WORK(&fep->phy_task, mii_display_config);
schedule_work(&fep->phy_task);
}

@@ -2330,6 +2356,7 @@

fep->index = index;
fep->hwp = fecp;
+ fep->netdev = dev;

/* Whack a reset. We should wait for this.
*/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/