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>
This commit is contained in:
Johannes Berg 2016-12-13 09:38:25 +01:00
parent 8fa3b6f939
commit 74204f8fa1
1 changed files with 1 additions and 4 deletions

View File

@ -478,10 +478,7 @@ bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked)
rfkill_led_trigger_event(rfkill); rfkill_led_trigger_event(rfkill);
if (!rfkill->registered) if (rfkill->registered && prev != blocked)
return ret;
if (prev != blocked)
schedule_work(&rfkill->uevent_work); schedule_work(&rfkill->uevent_work);
return ret; return ret;