Commit fe8e4e03 authored by Larry Finger's avatar Larry Finger Committed by Linus Torvalds

hp-wmi: handle rfkill_register() failure

Compilation of the HP WMI hotkeys code results in the following:

  CC [M]  drivers/platform/x86/hp-wmi.o
drivers/platform/x86/hp-wmi.c: In function hp_wmi_bios_setup:
drivers/platform/x86/hp-wmi.c:431: warning: ignoring return value of rfkill_register,
	 declared with attribute warn_unused_result
drivers/platform/x86/hp-wmi.c:441: warning: ignoring return value of rfkill_register,
	 declared with attribute warn_unused_result
drivers/platform/x86/hp-wmi.c:450: warning: ignoring return value of rfkill_register,
	 declared with attribute warn_unused_result
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 85c210ed
...@@ -428,7 +428,9 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) ...@@ -428,7 +428,9 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
wifi_rfkill->state = hp_wmi_wifi_state(); wifi_rfkill->state = hp_wmi_wifi_state();
wifi_rfkill->toggle_radio = hp_wmi_wifi_set; wifi_rfkill->toggle_radio = hp_wmi_wifi_set;
wifi_rfkill->user_claim_unsupported = 1; wifi_rfkill->user_claim_unsupported = 1;
rfkill_register(wifi_rfkill); err = rfkill_register(wifi_rfkill);
if (err)
goto add_sysfs_error;
} }
if (wireless & 0x2) { if (wireless & 0x2) {
...@@ -438,7 +440,8 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) ...@@ -438,7 +440,8 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
bluetooth_rfkill->state = hp_wmi_bluetooth_state(); bluetooth_rfkill->state = hp_wmi_bluetooth_state();
bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set; bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set;
bluetooth_rfkill->user_claim_unsupported = 1; bluetooth_rfkill->user_claim_unsupported = 1;
rfkill_register(bluetooth_rfkill); err = rfkill_register(bluetooth_rfkill);
goto register_bluetooth_error;
} }
if (wireless & 0x4) { if (wireless & 0x4) {
...@@ -447,10 +450,16 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) ...@@ -447,10 +450,16 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
wwan_rfkill->state = hp_wmi_wwan_state(); wwan_rfkill->state = hp_wmi_wwan_state();
wwan_rfkill->toggle_radio = hp_wmi_wwan_set; wwan_rfkill->toggle_radio = hp_wmi_wwan_set;
wwan_rfkill->user_claim_unsupported = 1; wwan_rfkill->user_claim_unsupported = 1;
rfkill_register(wwan_rfkill); err = rfkill_register(wwan_rfkill);
if (err)
goto register_wwan_err;
} }
return 0; return 0;
register_wwan_err:
rfkill_unregister(bluetooth_rfkill);
register_bluetooth_error:
rfkill_unregister(wifi_rfkill);
add_sysfs_error: add_sysfs_error:
cleanup_sysfs(device); cleanup_sysfs(device);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment