firmware: arm_scmi: Fix return error code in smc_send_message

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>
This commit is contained in:
Sudeep Holla 2020-04-17 11:32:32 +01:00
parent c5bceb98ce
commit f7199cf489
1 changed files with 4 additions and 1 deletions

View File

@ -114,7 +114,10 @@ static int smc_send_message(struct scmi_chan_info *cinfo,
mutex_unlock(&scmi_info->shmem_lock); 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, static void smc_fetch_response(struct scmi_chan_info *cinfo,