Skip to contentSkip to conversation

ath11k: clean up in qmi_txn_wait error code handling

PATCH In review Govindaraj Saminathan 2 participants 2 messages Jun 21, 2019 – Jun 24, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath11k: clean up in qmi_txn_wait error code handling

qmi_txn_wait functions resp.resp.result is assigned to ret variable and then returned from the function. The functions should not return error codes from firmware, instead it should return -EINVAL.

---
 drivers/net/wireless/ath/ath11k/qmi.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath11k/qmi.c +8 -8
index cb9ed9c..eb86fae 100644
@@ -1546,7 +1546,7 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab)
 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
 		ath11k_warn(ab, "Host capability request failed, result: %d, err: %d\n",
 			    resp.resp.result, resp.resp.error);
-		ret = resp.resp.result;
+		ret = -EINVAL;
 		goto out;
 	}
 
@@ -1610,7 +1610,7 @@ static int ath11k_qmi_fw_ind_register_send(struct ath11k_base *ab)
 	if (resp->resp.result != QMI_RESULT_SUCCESS_V01) {
 		ath11k_warn(ab, "FW Ind register request failed, result: %d, err: %d\n",
 			    resp->resp.result, resp->resp.error);
-		ret = resp->resp.result;
+		ret = -EINVAL;
 		goto out;
 	}
 
@@ -1666,7 +1666,7 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab)
 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
 		ath11k_warn(ab, "Respond mem req failed, result: %d, err: %d\n",
 			    resp.resp.result, resp.resp.error);
-		ret = resp.resp.result;
+		ret = -EINVAL;
 		goto out;
 	}
 out:
@@ -1753,7 +1753,7 @@ static int ath11k_qmi_request_target_cap(struct ath11k_base *ab)
 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
 		ath11k_warn(ab, "qmi targetcap req failed, result: %d, err: %d\n",
 			    resp.resp.result, resp.resp.error);
-		ret = resp.resp.result;
+		ret = -EINVAL;
 		goto out;
 	}
 
@@ -1921,7 +1921,7 @@ static int ath11k_qmi_load_bdf(struct ath11k_base *ab)
 		if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
 			ath11k_warn(ab, "qmi BDF download failed, result: %d, err: %d\n",
 				    resp.resp.result, resp.resp.error);
-			ret = resp.resp.result;
+			ret = -EINVAL;
 			goto out_qmi_bdf;
 		}
 	}
@@ -1970,7 +1970,7 @@ static int ath11k_qmi_wlanfw_m3_info_send(struct ath11k_base *ab)
 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
 		ath11k_warn(ab, "qmi M3 info request failed, result: %d, err: %d\n",
 			    resp.resp.result, resp.resp.error);
-		ret = resp.resp.result;
+		ret = -EINVAL;
 		goto out;
 	}
 out:
@@ -2021,7 +2021,7 @@ static int ath11k_qmi_wlanfw_mode_send(struct ath11k_base *ab,
 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
 		ath11k_warn(ab, "Mode request failed, mode: %d, result: %d err: %d\n",
 			    mode, resp.resp.result, resp.resp.error);
-		ret = resp.resp.result;
+		ret = -EINVAL;
 		goto out;
 	}
 
@@ -2099,7 +2099,7 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab)
 	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
 		ath11k_warn(ab, "qmi wlan config request failed, result: %d, err: %d\n",
 			    resp.resp.result, resp.resp.error);
-		ret = resp.resp.result;
+		ret = -EINVAL;
 		goto out;
 	}
 
Signature · 7 lines
1.9.1


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw
Quoted 6 lines · Govindaraj Saminathan

qmi_txn_wait functions resp.resp.result is assigned to ret variable and then returned from the function. The functions should not return error codes from firmware, instead it should return -EINVAL.

Patch applied to ath11k-bringup branch of ath.git, thanks.

d5fff50f82df ath11k: clean up in qmi_txn_wait error code handling

Signature · 9 lines
https://patchwork.kernel.org/patch/11009821/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k