1
0
Fork 0

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>
hifive-unleashed-5.1
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);
if (!rfkill->registered)
return ret;
if (prev != blocked)
if (rfkill->registered && prev != blocked)
schedule_work(&rfkill->uevent_work);
return ret;