vhost-net: switch to smp barriers
[safe/jmp/linux-2.6] / drivers / uwb / lc-rc.c
index 38e3d57..9611ef3 100644 (file)
@@ -79,7 +79,6 @@ static void uwb_rc_sys_release(struct device *dev)
        struct uwb_dev *uwb_dev = container_of(dev, struct uwb_dev, dev);
        struct uwb_rc *rc = container_of(uwb_dev, struct uwb_rc, uwb_dev);
 
-       uwb_rc_neh_destroy(rc);
        uwb_rc_ie_release(rc);
        kfree(rc);
 }
@@ -190,9 +189,9 @@ static int uwb_rc_setup(struct uwb_rc *rc)
        int result;
        struct device *dev = &rc->uwb_dev.dev;
 
-       result = uwb_rc_reset(rc);
+       result = uwb_radio_setup(rc);
        if (result < 0) {
-               dev_err(dev, "cannot reset UWB radio: %d\n", result);
+               dev_err(dev, "cannot setup UWB radio: %d\n", result);
                goto error;
        }
        result = uwb_rc_mac_addr_setup(rc);
@@ -289,8 +288,8 @@ error_sys_add:
 error_dev_add:
 error_rc_setup:
        rc->stop(rc);
-       uwbd_stop(rc);
 error_rc_start:
+       uwbd_stop(rc);
        return result;
 }
 EXPORT_SYMBOL_GPL(uwb_rc_add);
@@ -311,17 +310,13 @@ void uwb_rc_rm(struct uwb_rc *rc)
        rc->ready = 0;
 
        uwb_dbg_del_rc(rc);
-       uwb_rsv_cleanup(rc);
-       uwb_rc_ie_rm(rc, UWB_IDENTIFICATION_IE);
-       if (rc->beaconing >= 0)
-               uwb_rc_beacon(rc, -1, 0);
-       if (rc->scan_type != UWB_SCAN_DISABLED)
-               uwb_rc_scan(rc, rc->scanning, UWB_SCAN_DISABLED, 0);
-       uwb_rc_reset(rc);
+       uwb_rsv_remove_all(rc);
+       uwb_radio_shutdown(rc);
 
        rc->stop(rc);
 
        uwbd_stop(rc);
+       uwb_rc_neh_destroy(rc);
 
        uwb_dev_lock(&rc->uwb_dev);
        rc->priv = NULL;
@@ -331,6 +326,7 @@ void uwb_rc_rm(struct uwb_rc *rc)
        uwb_dev_for_each(rc, uwb_dev_offair_helper, NULL);
        __uwb_rc_sys_rm(rc);
        mutex_unlock(&rc->uwb_beca.mutex);
+       uwb_rsv_cleanup(rc);
        uwb_beca_release(rc);
        uwb_dev_rm(&rc->uwb_dev);
 }