summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/host_interface.c
diff options
context:
space:
mode:
authorAjay Singh2019-02-05 08:15:54 +0100
committerGreg Kroah-Hartman2019-02-07 13:31:20 +0100
commit98f83d3d01eb68e32e7b0de48aee8b19145a9d1b (patch)
treea8cf1221797432470a36624d03ae576d49acbb65 /drivers/staging/wilc1000/host_interface.c
parentstaging: wilc1000: remove unused struct 'add_sta_param' (diff)
downloadkernel-qcow2-linux-98f83d3d01eb68e32e7b0de48aee8b19145a9d1b.tar.gz
kernel-qcow2-linux-98f83d3d01eb68e32e7b0de48aee8b19145a9d1b.tar.xz
kernel-qcow2-linux-98f83d3d01eb68e32e7b0de48aee8b19145a9d1b.zip
staging: wilc1000: avoid use of 'hif_deinit_lock' static variable
Avoid use of static variable 'hif_deinit_lock' and move it as part of wilc struct. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/host_interface.c')
-rw-r--r--drivers/staging/wilc1000/host_interface.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 115b6f25d994..0fb6ca3133bb 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -130,8 +130,6 @@ struct wilc_join_bss_param {
};
} __packed;
-static struct mutex hif_deinit_lock;
-
/* 'msg' should be free by the caller for syc */
static struct host_if_msg*
wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *),
@@ -1645,7 +1643,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
vif->obtaining_ip = false;
if (wilc->clients_count == 0)
- mutex_init(&hif_deinit_lock);
+ mutex_init(&wilc->deinit_lock);
timer_setup(&vif->periodic_rssi, get_periodic_rssi, 0);
mod_timer(&vif->periodic_rssi, jiffies + msecs_to_jiffies(5000));
@@ -1673,7 +1671,7 @@ int wilc_deinit(struct wilc_vif *vif)
return -EFAULT;
}
- mutex_lock(&hif_deinit_lock);
+ mutex_lock(&vif->wilc->deinit_lock);
del_timer_sync(&hif_drv->scan_timer);
del_timer_sync(&hif_drv->connect_timer);
@@ -1693,7 +1691,7 @@ int wilc_deinit(struct wilc_vif *vif)
kfree(hif_drv);
vif->hif_drv = NULL;
vif->wilc->clients_count--;
- mutex_unlock(&hif_deinit_lock);
+ mutex_unlock(&vif->wilc->deinit_lock);
return result;
}
@@ -1746,31 +1744,31 @@ void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length)
struct host_if_drv *hif_drv;
struct wilc_vif *vif;
- mutex_lock(&hif_deinit_lock);
+ mutex_lock(&wilc->deinit_lock);
id = get_unaligned_le32(&buffer[length - 4]);
vif = wilc_get_vif_from_idx(wilc, id);
if (!vif) {
- mutex_unlock(&hif_deinit_lock);
+ mutex_unlock(&wilc->deinit_lock);
return;
}
hif_drv = vif->hif_drv;
if (!hif_drv) {
- mutex_unlock(&hif_deinit_lock);
+ mutex_unlock(&wilc->deinit_lock);
return;
}
if (!hif_drv->conn_info.conn_result) {
netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
- mutex_unlock(&hif_deinit_lock);
+ mutex_unlock(&wilc->deinit_lock);
return;
}
msg = wilc_alloc_work(vif, handle_rcvd_gnrl_async_info, false);
if (IS_ERR(msg)) {
- mutex_unlock(&hif_deinit_lock);
+ mutex_unlock(&wilc->deinit_lock);
return;
}
@@ -1781,7 +1779,7 @@ void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length)
kfree(msg);
}
- mutex_unlock(&hif_deinit_lock);
+ mutex_unlock(&wilc->deinit_lock);
}
void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length)