summaryrefslogtreecommitdiffstats
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
parentMerge tag 'cris-for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/je... (diff)
downloadlinux-74204f8fa117e7d0fa1d1a7a57c3c97df83ad418.tar.xz
linux-74204f8fa117e7d0fa1d1a7a57c3c97df83ad418.zip
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;