msm: board-msm7627a-wlan: fix the gpio_set_value_cansleep crash issue
Fix for the crash issue while turn ON/OFF WLAN in case 7627a FFA/Surf
by calling gpio_set_value_cansleep only if the gpio request is successful,
as the GPIO request can be failed due to GPIO expander hardware issue.
Change-Id: If610ad83962d52fcbc05508eb7ad9e9c84a730a8
CRs-Fixed: 365092
Signed-off-by: Santosh Sajjan <ssajjan@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm7627a-wlan.c b/arch/arm/mach-msm/board-msm7627a-wlan.c
index 07b7ab0..0949c5f 100644
--- a/arch/arm/mach-msm/board-msm7627a-wlan.c
+++ b/arch/arm/mach-msm/board-msm7627a-wlan.c
@@ -327,13 +327,16 @@
}
gpio_set_value(gpio_wlan_sys_rest_en, 0);
} else {
- gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
- rc = setup_wlan_gpio(on);
- if (rc) {
- pr_err("%s: wlan_set_gpio = %d\n", __func__, rc);
- goto set_gpio_fail;
+ rc = gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
+ if (!rc) {
+ rc = setup_wlan_gpio(on);
+ if (rc) {
+ pr_err("%s: setup_wlan_gpio = %d\n",
+ __func__, rc);
+ goto set_gpio_fail;
+ }
+ gpio_free(gpio_wlan_sys_rest_en);
}
- gpio_free(gpio_wlan_sys_rest_en);
}
/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */