From: Johannes Berg <[email protected]>

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 <[email protected]>
---
 net/rfkill/core.c | 5 +----
 1 file changed, 1 insertion(+), 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;
-- 
2.9.3

Reply via email to