diff options
Diffstat (limited to 'net/rfkill')
-rw-r--r-- | net/rfkill/rfkill.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index aa7039dfa19d..7a560b785097 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c | |||
@@ -501,17 +501,15 @@ static struct class rfkill_class = { | |||
501 | 501 | ||
502 | static int rfkill_add_switch(struct rfkill *rfkill) | 502 | static int rfkill_add_switch(struct rfkill *rfkill) |
503 | { | 503 | { |
504 | int error; | ||
505 | |||
506 | mutex_lock(&rfkill_mutex); | 504 | mutex_lock(&rfkill_mutex); |
507 | 505 | ||
508 | error = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type], 0); | 506 | rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type], 0); |
509 | if (!error) | 507 | |
510 | list_add_tail(&rfkill->node, &rfkill_list); | 508 | list_add_tail(&rfkill->node, &rfkill_list); |
511 | 509 | ||
512 | mutex_unlock(&rfkill_mutex); | 510 | mutex_unlock(&rfkill_mutex); |
513 | 511 | ||
514 | return error; | 512 | return 0; |
515 | } | 513 | } |
516 | 514 | ||
517 | static void rfkill_remove_switch(struct rfkill *rfkill) | 515 | static void rfkill_remove_switch(struct rfkill *rfkill) |