Przeglądaj źródła

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>
Johannes Berg 8 lat temu
rodzic
commit
74204f8fa1
1 zmienionych plików z 1 dodań i 4 usunięć
  1. 1 4
      net/rfkill/core.c

+ 1 - 4
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;