summaryrefslogtreecommitdiff
path: root/drivers/firmware/qcom_scm.h
diff options
context:
space:
mode:
authorAndy Gross <andy.gross@linaro.org>2016-06-04 02:25:24 +0300
committerAndy Gross <andy.gross@linaro.org>2016-06-24 21:33:59 +0300
commit11bdcee4a6b9ff0b09144a81a6b903cbfa599be7 (patch)
tree4eaa6e63a52bd7d03bcd8131be9876d34a423272 /drivers/firmware/qcom_scm.h
parent13e77747800ef71224a12f787ebd26b27c16ff12 (diff)
downloadlinux-11bdcee4a6b9ff0b09144a81a6b903cbfa599be7.tar.xz
firmware: qcom: scm: Generalize shared error map
This patch moves the qcom_scm_remap_error function to the include file where can be used by both the 32 and 64 bit versions of the code. Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <agross@codeaurora.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers/firmware/qcom_scm.h')
-rw-r--r--drivers/firmware/qcom_scm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h
index 2cce75c08b99..7dcc73381b7a 100644
--- a/drivers/firmware/qcom_scm.h
+++ b/drivers/firmware/qcom_scm.h
@@ -44,4 +44,20 @@ extern int __qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,
#define QCOM_SCM_ERROR -1
#define QCOM_SCM_INTERRUPTED 1
+static inline int qcom_scm_remap_error(int err)
+{
+ switch (err) {
+ case QCOM_SCM_ERROR:
+ return -EIO;
+ case QCOM_SCM_EINVAL_ADDR:
+ case QCOM_SCM_EINVAL_ARG:
+ return -EINVAL;
+ case QCOM_SCM_EOPNOTSUPP:
+ return -EOPNOTSUPP;
+ case QCOM_SCM_ENOMEM:
+ return -ENOMEM;
+ }
+ return -EINVAL;
+}
+
#endif