msm: board-msm7627a-wlan: fix the gpio free crash issue
Fix for the crash issue while turn ON/OFF WLAN in case SKU3,
SKU7 and 7627a FFA devices by having compile time block for
gpio_free code which is only applicable to QRD 7627a.
CRs-Fixed: 353715
Change-Id: I5f12fed723f1fc8853cd0c013241d80ca805cfc0
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 b72ecd4..5c2f801 100644
--- a/arch/arm/mach-msm/board-msm7627a-wlan.c
+++ b/arch/arm/mach-msm/board-msm7627a-wlan.c
@@ -285,7 +285,9 @@
gpio_fail:
gpio_free(gpio_wlan_sys_rest_en);
qrd_gpio_fail:
- gpio_free(GPIO_WLAN_3V3_EN);
+ /* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
+ if (machine_is_msm7627a_qrd1())
+ gpio_free(GPIO_WLAN_3V3_EN);
reg_disable:
wlan_switch_regulators(0);
out:
@@ -322,6 +324,7 @@
}
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);
@@ -359,7 +362,9 @@
gpio_fail:
gpio_free(gpio_wlan_sys_rest_en);
qrd_gpio_fail:
- gpio_free(GPIO_WLAN_3V3_EN);
+ /* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
+ if (machine_is_msm7627a_qrd1())
+ gpio_free(GPIO_WLAN_3V3_EN);
reg_disable:
wlan_switch_regulators(0);
pr_info("WLAN power-down failed\n");