diff options
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 4b7c24c519c3..7c789f0a94d7 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -428,7 +428,9 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) | |||
428 | wifi_rfkill->state = hp_wmi_wifi_state(); | 428 | wifi_rfkill->state = hp_wmi_wifi_state(); |
429 | wifi_rfkill->toggle_radio = hp_wmi_wifi_set; | 429 | wifi_rfkill->toggle_radio = hp_wmi_wifi_set; |
430 | wifi_rfkill->user_claim_unsupported = 1; | 430 | wifi_rfkill->user_claim_unsupported = 1; |
431 | rfkill_register(wifi_rfkill); | 431 | err = rfkill_register(wifi_rfkill); |
432 | if (err) | ||
433 | goto add_sysfs_error; | ||
432 | } | 434 | } |
433 | 435 | ||
434 | if (wireless & 0x2) { | 436 | if (wireless & 0x2) { |
@@ -438,7 +440,8 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) | |||
438 | bluetooth_rfkill->state = hp_wmi_bluetooth_state(); | 440 | bluetooth_rfkill->state = hp_wmi_bluetooth_state(); |
439 | bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set; | 441 | bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set; |
440 | bluetooth_rfkill->user_claim_unsupported = 1; | 442 | bluetooth_rfkill->user_claim_unsupported = 1; |
441 | rfkill_register(bluetooth_rfkill); | 443 | err = rfkill_register(bluetooth_rfkill); |
444 | goto register_bluetooth_error; | ||
442 | } | 445 | } |
443 | 446 | ||
444 | if (wireless & 0x4) { | 447 | if (wireless & 0x4) { |
@@ -447,10 +450,16 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) | |||
447 | wwan_rfkill->state = hp_wmi_wwan_state(); | 450 | wwan_rfkill->state = hp_wmi_wwan_state(); |
448 | wwan_rfkill->toggle_radio = hp_wmi_wwan_set; | 451 | wwan_rfkill->toggle_radio = hp_wmi_wwan_set; |
449 | wwan_rfkill->user_claim_unsupported = 1; | 452 | wwan_rfkill->user_claim_unsupported = 1; |
450 | rfkill_register(wwan_rfkill); | 453 | err = rfkill_register(wwan_rfkill); |
454 | if (err) | ||
455 | goto register_wwan_err; | ||
451 | } | 456 | } |
452 | 457 | ||
453 | return 0; | 458 | return 0; |
459 | register_wwan_err: | ||
460 | rfkill_unregister(bluetooth_rfkill); | ||
461 | register_bluetooth_error: | ||
462 | rfkill_unregister(wifi_rfkill); | ||
454 | add_sysfs_error: | 463 | add_sysfs_error: |
455 | cleanup_sysfs(device); | 464 | cleanup_sysfs(device); |
456 | return err; | 465 | return err; |