Skip to content

Commit 42c7a1c

Browse files
mukeshojha-linuxXin Liu
authored andcommitted
FROMLIST: soc: qcom: qmi: Print error codes in failure paths
Few error paths in the qmi_interface module log a failure message but do not include the actual error code. Include the error value in the log so debugging failures becomes easier. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Signed-off-by: Xin Liu <xin.liu@oss.qualcomm.com> Link: https://lore.kernel.org/all/20260202103641.3003867-2-mukesh.ojha@oss.qualcomm.com/
1 parent 349e69a commit 42c7a1c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/soc/qcom/qmi_interface.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ int qmi_txn_init(struct qmi_handle *qmi, struct qmi_txn *txn,
321321
mutex_lock(&qmi->txn_lock);
322322
ret = idr_alloc_cyclic(&qmi->txns, txn, 0, U16_MAX, GFP_KERNEL);
323323
if (ret < 0)
324-
pr_err("failed to allocate transaction id\n");
324+
pr_err("failed to allocate transaction id: %d\n", ret);
325325

326326
txn->id = ret;
327327
mutex_unlock(&qmi->txn_lock);
@@ -413,7 +413,7 @@ static void qmi_invoke_handler(struct qmi_handle *qmi, struct sockaddr_qrtr *sq,
413413

414414
ret = qmi_decode_message(buf, len, handler->ei, dest);
415415
if (ret < 0)
416-
pr_err("failed to decode incoming message\n");
416+
pr_err("failed to decode incoming message: %d\n", ret);
417417
else
418418
handler->fn(qmi, sq, txn, dest);
419419

@@ -502,7 +502,7 @@ static void qmi_handle_message(struct qmi_handle *qmi,
502502
if (txn->dest && txn->ei) {
503503
ret = qmi_decode_message(buf, len, txn->ei, txn->dest);
504504
if (ret < 0)
505-
pr_err("failed to decode incoming message\n");
505+
pr_err("failed to decode incoming message: %d\n", ret);
506506

507507
txn->result = ret;
508508
complete(&txn->completion);
@@ -661,8 +661,8 @@ int qmi_handle_init(struct qmi_handle *qmi, size_t recv_buf_size,
661661
if (PTR_ERR(qmi->sock) == -EAFNOSUPPORT) {
662662
ret = -EPROBE_DEFER;
663663
} else {
664-
pr_err("failed to create QMI socket\n");
665664
ret = PTR_ERR(qmi->sock);
665+
pr_err("failed to create QMI socket: %d\n", ret);
666666
}
667667
goto err_destroy_wq;
668668
}
@@ -766,7 +766,7 @@ static ssize_t qmi_send_message(struct qmi_handle *qmi,
766766
if (qmi->sock) {
767767
ret = kernel_sendmsg(qmi->sock, &msghdr, &iv, 1, len);
768768
if (ret < 0)
769-
pr_err("failed to send QMI message\n");
769+
pr_err("failed to send QMI message: %d\n", ret);
770770
} else {
771771
ret = -EPIPE;
772772
}

0 commit comments

Comments
 (0)