aboutsummaryrefslogtreecommitdiff
path: root/net/rfkill
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-12-13 09:38:25 +0100
committerJohannes Berg <johannes.berg@intel.com>2016-12-13 16:04:35 +0100
commit74204f8fa117e7d0fa1d1a7a57c3c97df83ad418 (patch)
tree2580bf12b385ad02bef1e270fa2a748cda23386a /net/rfkill
parent8fa3b6f9392bf6d90cb7b908e07bd90166639f0a (diff)
rfkill: simplify rfkill_set_hw_state() slightly
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>
Diffstat (limited to 'net/rfkill')
-rw-r--r--net/rfkill/core.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 884027f62783..184bb711a06d 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -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;