]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/rfkill/rfkill.c
PM: Introduce PM_EVENT_HIBERNATE callback state
[linux-2.6-omap-h63xx.git] / net / rfkill / rfkill.c
index 4469a7be006c270c4be87700cdf7364aa0a5d765..140a0a8c6b02fe5e5f4f4d0177a947aeb51d1692 100644 (file)
@@ -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;
        }