diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/rfkill/rfkill.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index 51d151c0e962..c6a9412fe5bd 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c | |||
@@ -388,19 +388,20 @@ int rfkill_register(struct rfkill *rfkill) | |||
388 | if (!rfkill->toggle_radio) | 388 | if (!rfkill->toggle_radio) |
389 | return -EINVAL; | 389 | return -EINVAL; |
390 | 390 | ||
391 | snprintf(dev->bus_id, sizeof(dev->bus_id), | ||
392 | "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1); | ||
393 | |||
394 | rfkill_led_trigger_register(rfkill); | ||
395 | |||
391 | error = rfkill_add_switch(rfkill); | 396 | error = rfkill_add_switch(rfkill); |
392 | if (error) | 397 | if (error) |
393 | return error; | 398 | return error; |
394 | 399 | ||
395 | snprintf(dev->bus_id, sizeof(dev->bus_id), | ||
396 | "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1); | ||
397 | |||
398 | error = device_add(dev); | 400 | error = device_add(dev); |
399 | if (error) { | 401 | if (error) { |
400 | rfkill_remove_switch(rfkill); | 402 | rfkill_remove_switch(rfkill); |
401 | return error; | 403 | return error; |
402 | } | 404 | } |
403 | rfkill_led_trigger_register(rfkill); | ||
404 | 405 | ||
405 | return 0; | 406 | return 0; |
406 | } | 407 | } |
@@ -416,9 +417,9 @@ EXPORT_SYMBOL(rfkill_register); | |||
416 | */ | 417 | */ |
417 | void rfkill_unregister(struct rfkill *rfkill) | 418 | void rfkill_unregister(struct rfkill *rfkill) |
418 | { | 419 | { |
419 | rfkill_led_trigger_unregister(rfkill); | ||
420 | device_del(&rfkill->dev); | 420 | device_del(&rfkill->dev); |
421 | rfkill_remove_switch(rfkill); | 421 | rfkill_remove_switch(rfkill); |
422 | rfkill_led_trigger_unregister(rfkill); | ||
422 | put_device(&rfkill->dev); | 423 | put_device(&rfkill->dev); |
423 | } | 424 | } |
424 | EXPORT_SYMBOL(rfkill_unregister); | 425 | EXPORT_SYMBOL(rfkill_unregister); |