Skip to content

Commit

Permalink
firmware: arm_scmi: Fix return error code in smc_send_message
Browse files Browse the repository at this point in the history
SMCCC can return NOT_SUPPORTED(-1). Map it to appropriate Linux error
codes namely -EOPNOTSUPP.

Link: https://lore.kernel.org/r/20200417103232.6896-1-sudeep.holla@arm.com
Reported-and-Tested-by:: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
  • Loading branch information
Sudeep Holla committed Apr 20, 2020
1 parent c5bceb9 commit f7199cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/firmware/arm_scmi/smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ static int smc_send_message(struct scmi_chan_info *cinfo,

mutex_unlock(&scmi_info->shmem_lock);

return res.a0;
/* Only SMCCC_RET_NOT_SUPPORTED is valid error code */
if (res.a0)
return -EOPNOTSUPP;
return 0;
}

static void smc_fetch_response(struct scmi_chan_info *cinfo,
Expand Down

0 comments on commit f7199cf

Please sign in to comment.