diff options
author | Andrey Vagin <avagin@parallels.com> | 2012-07-09 10:46:55 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2012-07-12 10:45:49 -0700 |
commit | 230efa68694bf978725fe155b4e81b1c8a9a565c (patch) | |
tree | 5edc8cfae9aca52725e21db4c8f3a2460669b757 /drivers/net | |
parent | f70624b6e536e99feeb793f1417375cce953966d (diff) | |
download | kernel_samsung_crespo-230efa68694bf978725fe155b4e81b1c8a9a565c.zip kernel_samsung_crespo-230efa68694bf978725fe155b4e81b1c8a9a565c.tar.gz kernel_samsung_crespo-230efa68694bf978725fe155b4e81b1c8a9a565c.tar.bz2 |
net: wireless: bcmdhd: Init locks in dhd_attach() at the beginning
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/bcmdhd/dhd_linux.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c index 2f48cbb..1cee01d 100644 --- a/drivers/net/wireless/bcmdhd/dhd_linux.c +++ b/drivers/net/wireless/bcmdhd/dhd_linux.c @@ -2644,17 +2644,8 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen) strcat(net->name, "%d"); } - if (dhd_add_if(dhd, 0, (void *)net, net->name, NULL, 0, 0) == DHD_BAD_IF) - goto fail; - dhd_state |= DHD_ATTACH_STATE_ADD_IF; - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)) - net->open = NULL; -#else - net->netdev_ops = NULL; -#endif - sema_init(&dhd->proto_sem, 1); + sema_init(&dhd->sdsem, 1); #ifdef PROP_TXSTATUS spin_lock_init(&dhd->wlfc_spinlock); @@ -2670,6 +2661,17 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen) spin_lock_init(&dhd->txqlock); spin_lock_init(&dhd->dhd_lock); + + if (dhd_add_if(dhd, 0, (void *)net, net->name, NULL, 0, 0) == DHD_BAD_IF) + goto fail; + dhd_state |= DHD_ATTACH_STATE_ADD_IF; + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)) + net->open = NULL; +#else + net->netdev_ops = NULL; +#endif + /* Initialize Wakelock stuff */ spin_lock_init(&dhd->wakelock_spinlock); dhd->wakelock_counter = 0; @@ -2722,7 +2724,6 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen) #ifdef DHDTHREAD /* Initialize thread based operation and lock */ - sema_init(&dhd->sdsem, 1); if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0)) { dhd->threads_only = TRUE; } |