rfkill: fix minor typo in kernel doc
[safe/jmp/linux-2.6] / net / rfkill / rfkill.c
index 4469a7b..f95081a 100644 (file)
@@ -92,7 +92,7 @@ void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state)
        rfkill_states[type] = state;
 
        list_for_each_entry(rfkill, &rfkill_list, node) {
-               if (!rfkill->user_claim)
+               if ((!rfkill->user_claim) && (rfkill->type == type))
                        rfkill_toggle_radio(rfkill, state);
        }
 
@@ -126,6 +126,9 @@ static ssize_t rfkill_type_show(struct device *dev,
        case RFKILL_TYPE_UWB:
                type = "ultrawideband";
                break;
+       case RFKILL_TYPE_WIMAX:
+               type = "wimax";
+               break;
        default:
                BUG();
        }
@@ -229,7 +232,7 @@ static int rfkill_suspend(struct device *dev, pm_message_t state)
        struct rfkill *rfkill = to_rfkill(dev);
 
        if (dev->power.power_state.event != state.event) {
-               if (state.event == PM_EVENT_SUSPEND) {
+               if (state.event & PM_EVENT_SLEEP) {
                        mutex_lock(&rfkill->mutex);
 
                        if (rfkill->state == RFKILL_STATE_ON)
@@ -337,7 +340,7 @@ EXPORT_SYMBOL(rfkill_allocate);
  * rfkill_free - Mark rfkill structure for deletion
  * @rfkill: rfkill structure to be destroyed
  *
- * Decrements reference count of rfkill structure so it is destoryed.
+ * Decrements reference count of rfkill structure so it is destroyed.
  * Note that rfkill_free() should _not_ be called after rfkill_unregister().
  */
 void rfkill_free(struct rfkill *rfkill)
@@ -392,11 +395,14 @@ int rfkill_register(struct rfkill *rfkill)
        rfkill_led_trigger_register(rfkill);
 
        error = rfkill_add_switch(rfkill);
-       if (error)
+       if (error) {
+               rfkill_led_trigger_unregister(rfkill);
                return error;
+       }
 
        error = device_add(dev);
        if (error) {
+               rfkill_led_trigger_unregister(rfkill);
                rfkill_remove_switch(rfkill);
                return error;
        }
@@ -406,7 +412,7 @@ int rfkill_register(struct rfkill *rfkill)
 EXPORT_SYMBOL(rfkill_register);
 
 /**
- * rfkill_unregister - Uegister a rfkill structure.
+ * rfkill_unregister - Unregister a rfkill structure.
  * @rfkill: rfkill structure to be unregistered
  *
  * This function should be called by the network driver during device