net: wireless: bcm4329: Init locks in dhd_attach() at the beginning

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
Andrey Vagin
2012-07-09 10:31:06 -07:00
committed by Dmitry Shmidt
parent fa98f042f1
commit f70624b6e5

View File

@@ -2086,6 +2086,17 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
memcpy(netdev_priv(net), &dhd, sizeof(dhd));
dhd->pub.osh = osh;
mutex_init(&dhd->proto_sem);
mutex_init(&dhd->sdsem);
/* Initialize other structure content */
init_waitqueue_head(&dhd->ioctl_resp_wait);
init_waitqueue_head(&dhd->ctrl_wait);
/* Initialize the spinlocks */
spin_lock_init(&dhd->sdlock);
spin_lock_init(&dhd->txqlock);
spin_lock_init(&dhd->dhd_lock);
/* Set network interface name if it was provided as module parameter */
if (iface_name[0]) {
int len;
@@ -2107,16 +2118,6 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
net->netdev_ops = NULL;
#endif
mutex_init(&dhd->proto_sem);
/* Initialize other structure content */
init_waitqueue_head(&dhd->ioctl_resp_wait);
init_waitqueue_head(&dhd->ctrl_wait);
/* Initialize the spinlocks */
spin_lock_init(&dhd->sdlock);
spin_lock_init(&dhd->txqlock);
spin_lock_init(&dhd->dhd_lock);
/* Initialize Wakelock stuff */
spin_lock_init(&dhd->wl_lock);
dhd->wl_count = 0;
@@ -2154,7 +2155,6 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
dhd->timer.function = dhd_watchdog;
/* Initialize thread based operation and lock */
mutex_init(&dhd->sdsem);
if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0)) {
dhd->threads_only = TRUE;
}