staging: rtl8188eu: Remove hw_init_mutex from struct rtw_usb_drv
authornavin patidar <navin.patidar@gmail.com>
Sun, 1 Jun 2014 12:16:30 +0000 (17:46 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2014 22:30:02 +0000 (15:30 -0700)
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/include/drv_types.h
drivers/staging/rtl8188eu/os_dep/os_intfs.c
drivers/staging/rtl8188eu/os_dep/usb_intf.c

index 10cc1a1bcab94a933377b0af98dc1a84dfc59a18..f40db1a24c2b00672e1dcf971dcb82d6afc7aa3a 100644 (file)
@@ -307,7 +307,7 @@ struct adapter {
 #endif
        struct adapter *pbuddy_adapter;
 
-       struct mutex *hw_init_mutex;
+       struct mutex hw_init_mutex;
 
        spinlock_t br_ext_lock;
        struct nat25_network_db_entry   *nethash[NAT25_HASH_SIZE];
index a220c579ab467eeeb92377650f17a628a71b4976..c9906e3428884cd28e548fd0c2b3ad32d77f9faa 100644 (file)
@@ -997,6 +997,8 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
        if (padapter->pbuddy_adapter != NULL)
                padapter->pbuddy_adapter->pbuddy_adapter = NULL;
 
+       mutex_destroy(&padapter->hw_init_mutex);
+
        RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-rtw_free_drv_sw\n"));
 
        return _SUCCESS;
@@ -1105,9 +1107,9 @@ int netdev_open(struct net_device *pnetdev)
        int ret;
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
 
-       _enter_critical_mutex(padapter->hw_init_mutex, NULL);
+       _enter_critical_mutex(&padapter->hw_init_mutex, NULL);
        ret = _netdev_open(pnetdev);
-       mutex_unlock(padapter->hw_init_mutex);
+       mutex_unlock(&padapter->hw_init_mutex);
        return ret;
 }
 
index d17218fec989b2bb44a9518837d284dd54f7ca26..523d5009baef5f836e3d6b5c3ea6ffe2b3579bc3 100644 (file)
@@ -63,7 +63,6 @@ MODULE_DEVICE_TABLE(usb, rtw_usb_id_tbl);
 struct rtw_usb_drv {
        struct usb_driver usbdrv;
        int drv_registered;
-       struct mutex hw_init_mutex;
 };
 
 static struct rtw_usb_drv rtl8188e_usb_drv = {
@@ -537,7 +536,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
        dvobj->if1 = padapter;
 
        padapter->bDriverStopped = true;
-       padapter->hw_init_mutex = &usb_drv->hw_init_mutex;
+       mutex_init(&padapter->hw_init_mutex);
        padapter->chip_type = RTL8188E;
 
        pnetdev = rtw_init_netdev(padapter);
@@ -732,8 +731,6 @@ static int __init rtw_drv_entry(void)
 
        DBG_88E(DRV_NAME " driver version=%s\n", DRIVERVERSION);
 
-       mutex_init(&usb_drv->hw_init_mutex);
-
        usb_drv->drv_registered = true;
        return usb_register(&usb_drv->usbdrv);
 }
@@ -746,7 +743,6 @@ static void __exit rtw_drv_halt(void)
        usb_drv->drv_registered = false;
        usb_deregister(&usb_drv->usbdrv);
 
-       mutex_destroy(&usb_drv->hw_init_mutex);
        DBG_88E("-rtw_drv_halt\n");
 }