* [PATCH]hp-wmi: Fix gps support in hp_wmi_rfkill_setup()
@ 2013-05-31 21:53 Kirill Tkhai
2013-05-31 22:15 ` Kirill Tkhai
0 siblings, 1 reply; 3+ messages in thread
From: Kirill Tkhai @ 2013-05-31 21:53 UTC (permalink / raw)
To: linux-kernel@vger.kernel.org; +Cc: Matthew Garrett, Trepák Vilmos
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@yandex.ru>
CC: Matthew Garrett <matthew.garrett@nebula.com>
CC: Trepák Vilmos <trepo@netcomga.sk>
---
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH]hp-wmi: Fix gps support in hp_wmi_rfkill_setup()
2013-05-31 21:53 [PATCH]hp-wmi: Fix gps support in hp_wmi_rfkill_setup() Kirill Tkhai
@ 2013-05-31 22:15 ` Kirill Tkhai
0 siblings, 0 replies; 3+ messages in thread
From: Kirill Tkhai @ 2013-05-31 22:15 UTC (permalink / raw)
To: linux-kernel@vger.kernel.org; +Cc: Matthew Garrett, Trepák Vilmos
One more error.. I'll resend patch to x86-platform mailing list
01.06.2013, 01:53, "Kirill Tkhai" <tkhai@yandex.ru>:
> 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@yandex.ru>
> CC: Matthew Garrett <matthew.garrett@nebula.com>
> CC: Trepák Vilmos <trepo@netcomga.sk>
> ---
> 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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH]hp-wmi: Fix gps support in hp_wmi_rfkill_setup()
@ 2013-05-31 23:16 Kirill Tkhai
0 siblings, 0 replies; 3+ messages in thread
From: Kirill Tkhai @ 2013-05-31 23:16 UTC (permalink / raw)
To: platform-driver-x86; +Cc: Matthew Garrett
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 rfkill_set_hw_state() wrong argument in case of gps
2)Fix wwan/gps register_*_error label order and error handling
Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
CC: Matthew Garrett <matthew.garrett@nebula.com>
CC: Trepák Vilmos <trepo@netcomga.sk>
---
drivers/platform/x86/hp-wmi.c | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 45cacf7..ef81b92 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -640,7 +640,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
(void *) HPWMI_BLUETOOTH);
if (!bluetooth_rfkill) {
err = -ENOMEM;
- goto register_wifi_error;
+ goto register_bluetooth_error;
}
rfkill_init_sw_state(bluetooth_rfkill,
hp_wmi_get_sw_state(HPWMI_BLUETOOTH));
@@ -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_wwan_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_gps_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,23 +688,27 @@ 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);
+ if (gps_rfkill)
+ rfkill_destroy(gps_rfkill);
gps_rfkill = NULL;
+ if (wwan_rfkill)
+ rfkill_unregister(wwan_rfkill);
+register_wwan_error:
+ if (wwan_rfkill)
+ rfkill_destroy(wwan_rfkill);
+ wwan_rfkill = NULL;
if (bluetooth_rfkill)
rfkill_unregister(bluetooth_rfkill);
register_bluetooth_error:
- rfkill_destroy(bluetooth_rfkill);
+ if (bluetooth_rfkill)
+ rfkill_destroy(bluetooth_rfkill);
bluetooth_rfkill = NULL;
if (wifi_rfkill)
rfkill_unregister(wifi_rfkill);
register_wifi_error:
- rfkill_destroy(wifi_rfkill);
+ if (wifi_rfkill)
+ rfkill_destroy(wifi_rfkill);
wifi_rfkill = NULL;
return err;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-31 23:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-31 21:53 [PATCH]hp-wmi: Fix gps support in hp_wmi_rfkill_setup() Kirill Tkhai
2013-05-31 22:15 ` Kirill Tkhai
-- strict thread matches above, loose matches on Subject: below --
2013-05-31 23:16 Kirill Tkhai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.