aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wlan-ng/prism2usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/wlan-ng/prism2usb.c')
-rw-r--r--drivers/staging/wlan-ng/prism2usb.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c
index 8abf3f87a2d5..41358bbc6246 100644
--- a/drivers/staging/wlan-ng/prism2usb.c
+++ b/drivers/staging/wlan-ng/prism2usb.c
@@ -67,7 +67,7 @@ static int prism2sta_probe_usb(struct usb_interface *interface,
dev = interface_to_usbdev(interface);
wlandev = create_wlan();
- if (wlandev == NULL) {
+ if (!wlandev) {
dev_err(&interface->dev, "Memory allocation failure.\n");
result = -EIO;
goto failed;
@@ -139,8 +139,7 @@ static void prism2sta_disconnect_usb(struct usb_interface *interface)
wlandev = (wlandevice_t *)usb_get_intfdata(interface);
if (wlandev != NULL) {
LIST_HEAD(cleanlist);
- struct list_head *entry;
- struct list_head *temp;
+ hfa384x_usbctlx_t *ctlx, *temp;
unsigned long flags;
hfa384x_t *hw = wlandev->priv;
@@ -178,18 +177,15 @@ static void prism2sta_disconnect_usb(struct usb_interface *interface)
tasklet_kill(&hw->completion_bh);
tasklet_kill(&hw->reaper_bh);
- flush_scheduled_work();
+ cancel_work_sync(&hw->link_bh);
+ cancel_work_sync(&hw->commsqual_bh);
/* Now we complete any outstanding commands
* and tell everyone who is waiting for their
* responses that we have shut down.
*/
- list_for_each(entry, &cleanlist) {
- hfa384x_usbctlx_t *ctlx;
-
- ctlx = list_entry(entry, hfa384x_usbctlx_t, list);
+ list_for_each_entry(ctlx, &cleanlist, list)
complete(&ctlx->done);
- }
/* Give any outstanding synchronous commands
* a chance to complete. All they need to do
@@ -199,12 +195,8 @@ static void prism2sta_disconnect_usb(struct usb_interface *interface)
msleep(100);
/* Now delete the CTLXs, because no-one else can now. */
- list_for_each_safe(entry, temp, &cleanlist) {
- hfa384x_usbctlx_t *ctlx;
-
- ctlx = list_entry(entry, hfa384x_usbctlx_t, list);
+ list_for_each_entry_safe(ctlx, temp, &cleanlist, list)
kfree(ctlx);
- }
/* Unhook the wlandev */
unregister_wlandev(wlandev);