summaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax/i2400m/netdev.c
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-09-16 17:53:57 -0700
committerInaky Perez-Gonzalez <inaky@linux.intel.com>2009-10-19 15:56:06 +0900
commit8f90f3ee83dc54e182d6a7548727cbae4b523e6e (patch)
tree8a81fd0076562a5c6e30a652c63fa25343783dc6 /drivers/net/wimax/i2400m/netdev.c
parentac53aed9349242095a780f57ac0c995fb170c950 (diff)
wimax/i2400m: cleanup initialization/destruction flow
Currently the i2400m driver was starting in a weird way: registering a network device, setting the device up and then registering a WiMAX device. This is an historic artifact, and was causing issues, a some early reports the device sends were getting lost by issue of the wimax_dev not being registered. Fix said situation by doing the wimax device registration in i2400m_setup() after network device registration and before starting thed device. As well, removed spurious setting of the state to UNINITIALIZED; i2400m.dev_start() does that already. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Diffstat (limited to 'drivers/net/wimax/i2400m/netdev.c')
-rw-r--r--drivers/net/wimax/i2400m/netdev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c
index 0e8f6a046b9..fefd794087a 100644
--- a/drivers/net/wimax/i2400m/netdev.c
+++ b/drivers/net/wimax/i2400m/netdev.c
@@ -102,11 +102,13 @@ int i2400m_open(struct net_device *net_dev)
struct device *dev = i2400m_dev(i2400m);
d_fnstart(3, dev, "(net_dev %p [i2400m %p])\n", net_dev, i2400m);
- if (i2400m->ready == 0) {
- dev_err(dev, "Device is still initializing\n");
- result = -EBUSY;
- } else
+ /* Make sure we wait until init is complete... */
+ mutex_lock(&i2400m->init_mutex);
+ if (i2400m->updown)
result = 0;
+ else
+ result = -EBUSY;
+ mutex_unlock(&i2400m->init_mutex);
d_fnend(3, dev, "(net_dev %p [i2400m %p]) = %d\n",
net_dev, i2400m, result);
return result;