All of lore.kernel.org
 help / color / mirror / Atom feed
From: Govindaraj Saminathan <gsamin@codeaurora.org>
To: ath11k@lists.infradead.org
Cc: Govindaraj Saminathan <gsamin@codeaurora.org>
Subject: [PATCH] ath11k: clean up in qmi_txn_wait error code handling
Date: Fri, 21 Jun 2019 16:47:33 +0530	[thread overview]
Message-ID: <1561115853-18202-1-git-send-email-gsamin@codeaurora.org> (raw)

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.

Signed-off-by: Govindaraj Saminathan <gsamin@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/qmi.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index cb9ed9c..eb86fae 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -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;
 	}
 
-- 
1.9.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

             reply	other threads:[~2019-06-21 11:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 11:17 Govindaraj Saminathan [this message]
2019-06-24 10:56 ` [PATCH] ath11k: clean up in qmi_txn_wait error code handling Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1561115853-18202-1-git-send-email-gsamin@codeaurora.org \
    --to=gsamin@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.