diff options
author | Mark Einon <mark.einon@gmail.com> | 2011-10-01 11:14:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-04 10:43:14 -0700 |
commit | d84b7e29d8ea049c352af89db69cff7e791a9418 (patch) | |
tree | bfc62af9045e6e9e0297d1378d1da541e87b225a | |
parent | 25e1c2780c2cef0456c850237abd895781d34e44 (diff) | |
download | linux-3.10-d84b7e29d8ea049c352af89db69cff7e791a9418.tar.gz linux-3.10-d84b7e29d8ea049c352af89db69cff7e791a9418.tar.bz2 linux-3.10-d84b7e29d8ea049c352af89db69cff7e791a9418.zip |
staging: et131x: Fix add_timer() from et131x_open
The error_timer was only getting initialised and an initial jiffies value set following a probe.
This could result in the timer needlessly expiring immediately after et131x_open is called.
Now this is all done from the open call instead.
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/et131x/README | 1 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x.h | 1 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x_initpci.c | 7 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x_netdev.c | 4 |
4 files changed, 5 insertions, 8 deletions
diff --git a/drivers/staging/et131x/README b/drivers/staging/et131x/README index 42c388d2098..a0ebaa0de53 100644 --- a/drivers/staging/et131x/README +++ b/drivers/staging/et131x/README @@ -9,7 +9,6 @@ Note, the powermanagement options were removed from the vendor provided driver as they did not build properly at the time. TODO: - - add_timer call in et131x_netdev.c is correct? - Implement a few more kernel Parameter (set mac ) Please send patches to: diff --git a/drivers/staging/et131x/et131x.h b/drivers/staging/et131x/et131x.h index 15486d11f95..c8f5ab14b6f 100644 --- a/drivers/staging/et131x/et131x.h +++ b/drivers/staging/et131x/et131x.h @@ -52,6 +52,7 @@ int et131x_init_eeprom(struct et131x_adapter *adapter); /* et131x_initpci.c */ +void et131x_error_timer_handler(unsigned long data); void et131x_configure_global_regs(struct et131x_adapter *adapter); void et131x_enable_interrupts(struct et131x_adapter *adapter); void et131x_disable_interrupts(struct et131x_adapter *adapter); diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c index e166fde8997..8bff4a08fa7 100644 --- a/drivers/staging/et131x/et131x_initpci.c +++ b/drivers/staging/et131x/et131x_initpci.c @@ -750,10 +750,6 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev, /* Copy address into the net_device struct */ memcpy(netdev->dev_addr, adapter->addr, ETH_ALEN); - adapter->error_timer.expires = jiffies + TX_ERROR_PERIOD * HZ / 1000; - adapter->error_timer.function = et131x_error_timer_handler; - adapter->error_timer.data = (unsigned long)adapter; - /* Init variable for counting how long we do not have link status */ adapter->boot_coma = 0; et1310_disable_phy_coma(adapter); @@ -795,9 +791,6 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev, /* Setup et1310 as per the documentation */ et131x_adapter_setup(adapter); - /* Create a timer to count errors received by the NIC */ - init_timer(&adapter->error_timer); - /* We can enable interrupts now * * NOTE - Because registration of interrupt handler is done in the diff --git a/drivers/staging/et131x/et131x_netdev.c b/drivers/staging/et131x/et131x_netdev.c index 6ec4a0f2919..21846827e6c 100644 --- a/drivers/staging/et131x/et131x_netdev.c +++ b/drivers/staging/et131x/et131x_netdev.c @@ -187,6 +187,10 @@ int et131x_open(struct net_device *netdev) struct et131x_adapter *adapter = netdev_priv(netdev); /* Start the timer to track NIC errors */ + init_timer(&adapter->error_timer); + adapter->error_timer.expires = jiffies + TX_ERROR_PERIOD * HZ / 1000; + adapter->error_timer.function = et131x_error_timer_handler; + adapter->error_timer.data = (unsigned long)adapter; add_timer(&adapter->error_timer); /* Register our IRQ */ |