Merge "soc: qcom: Fix checks for QMI response values"
This commit is contained in:
commit
a03b6a8e6e
3 changed files with 14 additions and 18 deletions
|
@ -31,7 +31,6 @@
|
|||
|
||||
#define SERVREG_LOC_SERVICE_INSTANCE_ID 1
|
||||
|
||||
#define QMI_RESP_BIT_SHIFT(x) (x << 16)
|
||||
#define QMI_SERVREG_LOC_SERVER_INITIAL_TIMEOUT 2000
|
||||
#define QMI_SERVREG_LOC_SERVER_TIMEOUT 2000
|
||||
#define INITIAL_TIMEOUT 100000
|
||||
|
@ -199,9 +198,9 @@ static int servreg_loc_send_msg(struct msg_desc *req_desc,
|
|||
}
|
||||
|
||||
/* Check the response */
|
||||
if (QMI_RESP_BIT_SHIFT(resp->resp.result) != QMI_RESULT_SUCCESS_V01) {
|
||||
if (resp->resp.result != QMI_RESULT_SUCCESS_V01) {
|
||||
pr_err("QMI request for client %s failed 0x%x\n",
|
||||
pd->client_name, QMI_RESP_BIT_SHIFT(resp->resp.error));
|
||||
pd->client_name, resp->resp.error);
|
||||
return -EREMOTEIO;
|
||||
}
|
||||
return rc;
|
||||
|
@ -220,7 +219,7 @@ static int service_locator_send_msg(struct pd_qmi_client_data *pd)
|
|||
return -EAGAIN;
|
||||
}
|
||||
|
||||
req = kmalloc(sizeof(
|
||||
req = kzalloc(sizeof(
|
||||
struct qmi_servreg_loc_get_domain_list_req_msg_v01),
|
||||
GFP_KERNEL);
|
||||
if (!req) {
|
||||
|
@ -228,7 +227,7 @@ static int service_locator_send_msg(struct pd_qmi_client_data *pd)
|
|||
rc = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
resp = kmalloc(sizeof(
|
||||
resp = kzalloc(sizeof(
|
||||
struct qmi_servreg_loc_get_domain_list_resp_msg_v01),
|
||||
GFP_KERNEL);
|
||||
if (!resp) {
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <soc/qcom/service-notifier.h>
|
||||
#include "service-notifier-private.h"
|
||||
|
||||
#define QMI_RESP_BIT_SHIFT(x) (x << 16)
|
||||
#define SERVREG_NOTIF_NAME_LENGTH QMI_SERVREG_NOTIF_NAME_LENGTH_V01
|
||||
#define SERVREG_NOTIF_SERVICE_ID SERVREG_NOTIF_SERVICE_ID_V01
|
||||
#define SERVREG_NOTIF_SERVICE_VERS SERVREG_NOTIF_SERVICE_VERS_V01
|
||||
|
@ -225,9 +224,8 @@ static void send_ind_ack(struct work_struct *work)
|
|||
}
|
||||
|
||||
/* Check the response */
|
||||
if (QMI_RESP_BIT_SHIFT(resp.resp.result) != QMI_RESULT_SUCCESS_V01)
|
||||
pr_err("QMI request failed 0x%x\n",
|
||||
QMI_RESP_BIT_SHIFT(resp.resp.error));
|
||||
if (resp.resp.result != QMI_RESULT_SUCCESS_V01)
|
||||
pr_err("QMI request failed 0x%x\n", resp.resp.error);
|
||||
pr_info("Indication ACKed for transid %d, service %s, instance %d!\n",
|
||||
data->ind_msg.transaction_id, data->ind_msg.service_path,
|
||||
data->instance_id);
|
||||
|
@ -318,9 +316,8 @@ static int send_notif_listener_msg_req(struct service_notif_info *service_notif,
|
|||
}
|
||||
|
||||
/* Check the response */
|
||||
if (QMI_RESP_BIT_SHIFT(resp.resp.result) != QMI_RESULT_SUCCESS_V01) {
|
||||
pr_err("QMI request failed 0x%x\n",
|
||||
QMI_RESP_BIT_SHIFT(resp.resp.error));
|
||||
if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
|
||||
pr_err("QMI request failed 0x%x\n", resp.resp.error);
|
||||
return -EREMOTEIO;
|
||||
}
|
||||
|
||||
|
@ -645,15 +642,15 @@ static int send_pd_restart_req(const char *service_path,
|
|||
}
|
||||
|
||||
/* Check response if PDR is disabled */
|
||||
if (QMI_RESP_BIT_SHIFT(resp.resp.result) == QMI_ERR_DISABLED_V01) {
|
||||
pr_err("PD restart is disabled 0x%x\n",
|
||||
QMI_RESP_BIT_SHIFT(resp.resp.error));
|
||||
if (resp.resp.result == QMI_RESULT_FAILURE_V01 &&
|
||||
resp.resp.error == QMI_ERR_DISABLED_V01) {
|
||||
pr_err("PD restart is disabled 0x%x\n", resp.resp.error);
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
/* Check the response for other error case*/
|
||||
if (QMI_RESP_BIT_SHIFT(resp.resp.result) != QMI_RESULT_SUCCESS_V01) {
|
||||
if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
|
||||
pr_err("QMI request for PD restart failed 0x%x\n",
|
||||
QMI_RESP_BIT_SHIFT(resp.resp.error));
|
||||
resp.resp.error);
|
||||
return -EREMOTEIO;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,6 @@ enum qmi_result_type_v01 {
|
|||
QMI_RESULT_TYPE_MIN_ENUM_VAL_V01 = INT_MIN,
|
||||
QMI_RESULT_SUCCESS_V01 = 0,
|
||||
QMI_RESULT_FAILURE_V01 = 1,
|
||||
QMI_ERR_DISABLED_V01 = 0x45,
|
||||
QMI_RESULT_TYPE_MAX_ENUM_VAL_V01 = INT_MAX,
|
||||
};
|
||||
|
||||
|
@ -106,6 +105,7 @@ enum qmi_error_type_v01 {
|
|||
QMI_ERR_CLIENT_IDS_EXHAUSTED_V01 = 0x0005,
|
||||
QMI_ERR_INVALID_ID_V01 = 0x0029,
|
||||
QMI_ERR_ENCODING_V01 = 0x003A,
|
||||
QMI_ERR_DISABLED_V01 = 0x0045,
|
||||
QMI_ERR_INCOMPATIBLE_STATE_V01 = 0x005A,
|
||||
QMI_ERR_NOT_SUPPORTED_V01 = 0x005E,
|
||||
QMI_ERR_TYPE_MAX_ENUM_VAL_V01 = INT_MAX,
|
||||
|
|
Loading…
Add table
Reference in a new issue