From: navin patidar Date: Sun, 1 Jun 2014 12:16:30 +0000 (+0530) Subject: staging: rtl8188eu: Remove hw_init_mutex from struct rtw_usb_drv X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fc8b5ae9aa4ac551a8e33a2ac617c4e2fc102225;p=linux-beck.git staging: rtl8188eu: Remove hw_init_mutex from struct rtw_usb_drv Signed-off-by: navin patidar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h index 10cc1a1bcab9..f40db1a24c2b 100644 --- a/drivers/staging/rtl8188eu/include/drv_types.h +++ b/drivers/staging/rtl8188eu/include/drv_types.h @@ -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]; diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index a220c579ab46..c9906e342888 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -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; } diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c index d17218fec989..523d5009baef 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c @@ -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"); }