disp: msm: fix checking returned value of xx_cmd_transfer
Change the checking returned value of dsi_ctrl_cmd_transfer(), because if this is a read command then it will return the number byte of reading when reading succeed. If this is a write command, then it will return "none-zero" for failure. Port from: 01f1152 Change-Id: I961102933e4aad3d2ec99ffaa8cf6d81adac501f Signed-off-by: Bang Nguyen <bangnguyen@motorola.com> Reviewed-on: https://gerrit.mot.com/1444415 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1509816 Reviewed-by: Hua Tan <tanhua1@motorola.com>
This commit is contained in:
1 parent
b0652e4563
commit
df88a52787
1 file changed
+3
-2
@@ -3219,10 +3219,11 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host,
|
||||
cmd_flags |= DSI_CTRL_CMD_ASYNC_WAIT;
|
||||
|
||||
if (msg->rx_buf)
|
||||
flags |= DSI_CTRL_CMD_READ;
|
||||
cmd_flags |= DSI_CTRL_CMD_READ;
|
||||
rc = dsi_ctrl_cmd_transfer(display->ctrl[ctrl_idx].ctrl, msg,
|
||||
&cmd_flags);
|
||||
if (rc) {
|
||||
if (((cmd_flags & DSI_CTRL_CMD_READ) && rc <= 0) ||
|
||||
(!(cmd_flags & DSI_CTRL_CMD_READ) && rc)) {
|
||||
DSI_ERR("[%s] cmd transfer failed, rc=%d\n",
|
||||
display->name, rc);
|
||||
goto error_disable_cmd_engine;
|
||||
|
||||
Reference in new issue
Block a user