diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2020-04-17 13:32:32 +0300 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2020-04-20 19:57:34 +0300 |
commit | f7199cf489027ae38a9a82312d13025f7aefa0b8 (patch) | |
tree | 339c0562d1254506b687b1899686bc43e9372668 /drivers/firmware/arm_scmi | |
parent | c5bceb98ce0e4ae8057a386c5171a868213fe226 (diff) | |
download | linux-f7199cf489027ae38a9a82312d13025f7aefa0b8.tar.xz |
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>
Diffstat (limited to 'drivers/firmware/arm_scmi')
-rw-r--r-- | drivers/firmware/arm_scmi/smc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c index 833e793b5391..49bc4b0e8428 100644 --- a/drivers/firmware/arm_scmi/smc.c +++ b/drivers/firmware/arm_scmi/smc.c @@ -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, |