Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1413583

[Patch v6 04/10] firmware: qcom: scm: Generalize shared error map

From Andy Gross <andy.gross@linaro.org>
Newsgroups linux.kernel
Subject [Patch v6 04/10] firmware: qcom: scm: Generalize shared error map
Date 2016-06-04 01:30 +0200
Message-ID <rG6Ho-19i-19@gated-at.bofh.it> (permalink)
References <rG6Hn-19i-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/firmware/qcom_scm-32.c | 17 -----------------
 drivers/firmware/qcom_scm.h    | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c
index 5be6a12..4388d13 100644
--- a/drivers/firmware/qcom_scm-32.c
+++ b/drivers/firmware/qcom_scm-32.c
@@ -168,23 +168,6 @@ static inline void *qcom_scm_get_response_buffer(const struct qcom_scm_response
 	return (void *)rsp + le32_to_cpu(rsp->buf_offset);
 }
 
-static int qcom_scm_remap_error(int err)
-{
-	pr_err("qcom_scm_call failed with error code %d\n", 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;
-}
-
 static u32 smc(u32 cmd_addr)
 {
 	int context_id;
diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h
index 2cce75c..7dcc733 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
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[Patch v6 00/10] Qualcomm SCM Rework Andy Gross <andy.gross@linaro.org> - 2016-06-04 01:30 +0200
  [Patch v6 05/10] firmware: qcom: scm: Convert to streaming DMA APIS Andy Gross <andy.gross@linaro.org> - 2016-06-04 01:30 +0200
  [Patch v6 07/10] dts: qcom: apq8084: Add SCM firmware node Andy Gross <andy.gross@linaro.org> - 2016-06-04 01:30 +0200
  [Patch v6 10/10] dts: qcom: apq8064: Add SCM firmware node Andy Gross <andy.gross@linaro.org> - 2016-06-04 01:30 +0200
    Re: [Patch v6 10/10] dts: qcom: apq8064: Add SCM firmware node Stephen Boyd <sboyd@codeaurora.org> - 2016-06-04 02:10 +0200
  [Patch v6 04/10] firmware: qcom: scm: Generalize shared error map Andy Gross <andy.gross@linaro.org> - 2016-06-04 01:30 +0200
  [Patch v6 06/10] firmware: qcom: scm: Add support for ARM64 SoCs Andy Gross <andy.gross@linaro.org> - 2016-06-04 01:30 +0200

csiph-web