Parcourir la source

qcacld-3.0: Modify the return statuses of OS_IF QMI APIs

Use existing failure return statuses for os_if QMI APIs.

Change-Id: I49abbf8d10f04df3bd4ef7d2796ee72d281409a0
CRs-Fixed: 3356631
Yeshwanth Sriram Guntuka il y a 2 ans
Parent
commit
bac8bc45cf
1 fichiers modifiés avec 16 ajouts et 12 suppressions
  1. 16 12
      os_if/qmi/src/os_if_qmi.c

+ 16 - 12
os_if/qmi/src/os_if_qmi.c

@@ -31,8 +31,10 @@ QDF_STATUS os_if_qmi_handle_init(struct qmi_handle *qmi_hdl,
 	int ret;
 
 	ret = qmi_handle_init(qmi_hdl, recv_buf_size, ops, qmi_msg_handlers);
-	if (ret < 0)
-		return QDF_STATUS_QMI_HANDLE_INIT_FAILED;
+	if (ret < 0) {
+		osif_err("QMI handle initialization failed %d", ret);
+		return qdf_status_from_os_return(ret);
+	}
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -49,8 +51,10 @@ QDF_STATUS os_if_qmi_add_lookup(struct qmi_handle *qmi_hdl,
 	int ret;
 
 	ret = qmi_add_lookup(qmi_hdl, service, version, instance);
-	if (ret < 0)
-		return QDF_STATUS_QMI_ADD_LOOKUP_FAILED;
+	if (ret < 0) {
+		osif_err("QMI add lookup failed %d", ret);
+		return qdf_status_from_os_return(ret);
+	}
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -71,8 +75,8 @@ QDF_STATUS os_if_qmi_connect_to_svc(struct qmi_handle *qmi_hdl,
 	ret = kernel_connect(qmi_hdl->sock, (struct sockaddr *)&sq,
 			     sizeof(sq), 0);
 	if (ret < 0) {
-		osif_err("Failed to connect to QMI remote service");
-		return QDF_STATUS_QMI_SVC_CONNECT_FAILED;
+		osif_err("Failed to connect to QMI remote service %d", ret);
+		return qdf_status_from_os_return(ret);
 	}
 
 	return QDF_STATUS_SUCCESS;
@@ -86,8 +90,8 @@ QDF_STATUS os_if_qmi_txn_init(struct qmi_handle *qmi_hdl,
 
 	ret = qmi_txn_init(qmi_hdl, qmi_txn, qmi_ei, resp);
 	if (ret < 0) {
-		osif_info("QMI transaction init failed");
-		return QDF_STATUS_QMI_TXN_INIT_FAILED;
+		osif_info("QMI transaction init failed %d", ret);
+		return qdf_status_from_os_return(ret);
 	}
 
 	return QDF_STATUS_SUCCESS;
@@ -103,8 +107,8 @@ QDF_STATUS os_if_qmi_send_request(struct qmi_handle *qmi_hdl,
 
 	ret = qmi_send_request(qmi_hdl, sq, qmi_txn, msg_id, len, ei, req);
 	if (ret < 0) {
-		osif_info("QMI send request failed");
-		return QDF_STATUS_QMI_SEND_REQ_FAILED;
+		osif_info("QMI send request failed %d", ret);
+		return qdf_status_from_os_return(ret);
 	}
 
 	return QDF_STATUS_SUCCESS;
@@ -116,8 +120,8 @@ QDF_STATUS os_if_qmi_txn_wait(struct qmi_txn *qmi_txn, unsigned long timeout)
 
 	ret = qmi_txn_wait(qmi_txn, timeout);
 	if (ret < 0) {
-		osif_info("QMI Failed to wait for response");
-		return QDF_STATUS_QMI_TXN_WAIT_FAILED;
+		osif_info("QMI Failed to wait for response %d", ret);
+		return qdf_status_from_os_return(ret);
 	}
 
 	return QDF_STATUS_SUCCESS;