]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rfkill: simplify rfkill_set_hw_state() slightly
authorJohannes Berg <johannes.berg@intel.com>
Tue, 13 Dec 2016 08:38:25 +0000 (09:38 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 13 Dec 2016 15:04:35 +0000 (16:04 +0100)
Simplify the two conditions gating the schedule_work() into
a single one and get rid of the additional exit point from
the function in doing so.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/rfkill/core.c

index 884027f62783a6a975b42c0bdd5f39010df9834a..184bb711a06d6b257fdca10c2100da80fac7766f 100644 (file)
@@ -478,10 +478,7 @@ bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked)
 
        rfkill_led_trigger_event(rfkill);
 
-       if (!rfkill->registered)
-               return ret;
-
-       if (prev != blocked)
+       if (rfkill->registered && prev != blocked)
                schedule_work(&rfkill->uevent_work);
 
        return ret;