summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuanyuan Liu <yuanliu@codeaurora.org>2017-10-09 17:30:13 -0700
committersnandini <snandini@codeaurora.org>2017-10-10 16:13:18 -0700
commit87c110ee79db8c1f72bce8a73f991f830c91d196 (patch)
tree34bb422d93c88149bf6c1270ed85d93834a78167
parent6f735fe7bbead3f9b10de933f4631cc8e02086a4 (diff)
qcacld-3.0: Convert probe return error from -ENOMEM to -EPROBE_DEFER
If probe failed becasue of no memory, we want to try to recovery by issuing a re-probe for built-in driver. Hence, convert probe return error from -ENOMEM to -EPROBE_DEFER for built-in driver so that platform driver can issue re-probe based on the return value. CRs-Fixed: 2124159 Change-Id: I6cca0ed186554c8065b77af8c178ca9e143abf98
-rw-r--r--core/hdd/src/wlan_hdd_driver_ops.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c
index 03ad98ce02b0..15197c4d3e26 100644
--- a/core/hdd/src/wlan_hdd_driver_ops.c
+++ b/core/hdd/src/wlan_hdd_driver_ops.c
@@ -320,6 +320,27 @@ static void hdd_init_qdf_ctx(struct device *dev, void *bdev,
}
/**
+ * check_for_probe_defer() - API to check return value
+ * @ret: Return Value
+ *
+ * Return: return -EPROBE_DEFER to platform driver if return value
+ * is -ENOMEM. Platform driver will try to re-probe.
+ */
+#ifdef MODULE
+static int check_for_probe_defer(int ret)
+{
+ return ret;
+}
+#else
+static int check_for_probe_defer(int ret)
+{
+ if (ret == -ENOMEM)
+ return -EPROBE_DEFER;
+ return ret;
+}
+#endif
+
+/**
* wlan_hdd_probe() - handles probe request
*
* This function is called to probe the wlan driver
@@ -416,7 +437,7 @@ err_hdd_deinit:
cds_clear_fw_state(CDS_FW_STATE_DOWN);
hdd_stop_driver_ops_timer();
mutex_unlock(&hdd_init_deinit_lock);
- return ret;
+ return check_for_probe_defer(ret);
}
static inline void hdd_pld_driver_unloading(struct device *dev)