Re: [PATCH]hp-wmi: Fix gps support in hp_wmi_rfkill_setup()

From: Kirill Tkhai
Date: Fri May 31 2013 - 18:21:38 EST


One more error.. I'll resend patch to x86-platform mailing list

01.06.2013, 01:53, "Kirill Tkhai" <tkhai@xxxxxxxxx>:
> Current gps support in hp_wmi_rfkill_setup() looks like bad copy/past.
> It leads to kernel panic on my HP530 laptop. So I did:
>
> 1)Fix wwan/gps register_*_error label order
> 2)Fix rfkill_set_hw_state() wrong argument in case of gps
>
> Signed-off-by: Kirill Tkhai <tkhai@xxxxxxxxx>
> CC: Matthew Garrett <matthew.garrett@xxxxxxxxxx>
> CC: TrepÃk Vilmos <trepo@xxxxxxxxxxx>
> ---
> Âdrivers/platform/x86/hp-wmi.c | ÂÂ18 +++++++++---------
> Â1 file changed, 9 insertions(+), 9 deletions(-)
> diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
> index 45cacf7..cdb8afb 100644
> --- a/drivers/platform/x86/hp-wmi.c
> +++ b/drivers/platform/x86/hp-wmi.c
> @@ -658,7 +658,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ(void *) HPWMI_WWAN);
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (!wwan_rfkill) {
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂerr = -ENOMEM;
> - goto register_gps_error;
> + goto register_bluetooth_error;
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂrfkill_init_sw_state(wwan_rfkill,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂhp_wmi_get_sw_state(HPWMI_WWAN));
> @@ -666,7 +666,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂhp_wmi_get_hw_state(HPWMI_WWAN));
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂerr = rfkill_register(wwan_rfkill);
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (err)
> - goto register_wwan_err;
> + goto register_wwan_error;
> ÂÂÂÂÂÂÂÂÂ}
>
> ÂÂÂÂÂÂÂÂÂif (wireless & 0x8) {
> @@ -676,11 +676,11 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ(void *) HPWMI_GPS);
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (!gps_rfkill) {
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂerr = -ENOMEM;
> - goto register_bluetooth_error;
> + goto register_wwan_error;
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂrfkill_init_sw_state(gps_rfkill,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂhp_wmi_get_sw_state(HPWMI_GPS));
> - rfkill_set_hw_state(bluetooth_rfkill,
> + rfkill_set_hw_state(gps_rfkill,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂhp_wmi_get_hw_state(HPWMI_GPS));
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂerr = rfkill_register(gps_rfkill);
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (err)
> @@ -688,16 +688,16 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
> ÂÂÂÂÂÂÂÂÂ}
>
> ÂÂÂÂÂÂÂÂÂreturn 0;
> -register_wwan_err:
> - rfkill_destroy(wwan_rfkill);
> - wwan_rfkill = NULL;
> - if (gps_rfkill)
> - rfkill_unregister(gps_rfkill);
> Âregister_gps_error:
> ÂÂÂÂÂÂÂÂÂrfkill_destroy(gps_rfkill);
> ÂÂÂÂÂÂÂÂÂgps_rfkill = NULL;
> ÂÂÂÂÂÂÂÂÂif (bluetooth_rfkill)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂrfkill_unregister(bluetooth_rfkill);
> +register_wwan_error:
> + rfkill_destroy(wwan_rfkill);
> + wwan_rfkill = NULL;
> + if (gps_rfkill)
> + rfkill_unregister(gps_rfkill);
> Âregister_bluetooth_error:
> ÂÂÂÂÂÂÂÂÂrfkill_destroy(bluetooth_rfkill);
> ÂÂÂÂÂÂÂÂÂbluetooth_rfkill = NULL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/