summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAdham Abozaeid <adham.abozaeid@microchip.com>2019-03-27 20:28:34 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-29 17:10:18 +0100
commiteab0754655a6bb20a0e3a863ef3e46b176040ca7 (patch)
treed51f756175232f3a3e12ea45540cc5259c6665a4 /drivers
parent3589e74873a91b2d1ab4b902bc55cbebc0581317 (diff)
downloadlinux-eab0754655a6bb20a0e3a863ef3e46b176040ca7.tar.bz2
staging: wilc1000: assign scan result callback before starting the scan
When scan is triggered, sometimes scan results are received before the scan result callback is assigned, causing the recieved results to be ignored. Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/wilc1000/host_interface.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 91ea16a6ae2e..e1a35bb426f9 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -313,6 +313,9 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
wid_list[index].val = (s8 *)&scan_source;
index++;
+ hif_drv->usr_scan_req.scan_result = scan_result_fn;
+ hif_drv->usr_scan_req.arg = user_arg;
+
result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list,
index,
wilc_get_vif_idx(vif));
@@ -321,8 +324,6 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
goto error;
}
- hif_drv->usr_scan_req.scan_result = scan_result_fn;
- hif_drv->usr_scan_req.arg = user_arg;
hif_drv->scan_timer_vif = vif;
mod_timer(&hif_drv->scan_timer,
jiffies + msecs_to_jiffies(WILC_HIF_SCAN_TIMEOUT_MS));