Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
[firefly-linux-kernel-4.4.55.git] / net / rfkill / rfkill.c
index 1a47f5d1be17c42814d83f705bd375de497c2b80..4e10a95de8321acfd3ea3aa37885d1519f2a0ecf 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);
        }
 
@@ -232,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)