From 74204f8fa117e7d0fa1d1a7a57c3c97df83ad418 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 13 Dec 2016 09:38:25 +0100 Subject: 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 --- net/rfkill/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'net/rfkill/core.c') 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; -- cgit