From patchwork Fri Jun 3 23:25:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 69315 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp497434qgf; Fri, 3 Jun 2016 16:27:38 -0700 (PDT) X-Received: by 10.36.68.88 with SMTP id o85mr2927475ita.39.1464996458384; Fri, 03 Jun 2016 16:27:38 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m129si7692880pfm.15.2016.06.03.16.27.38; Fri, 03 Jun 2016 16:27:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750967AbcFCX1K (ORCPT + 8 others); Fri, 3 Jun 2016 19:27:10 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:36480 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783AbcFCXZt (ORCPT ); Fri, 3 Jun 2016 19:25:49 -0400 Received: by mail-oi0-f46.google.com with SMTP id j1so149677215oih.3 for ; Fri, 03 Jun 2016 16:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=InnhxhnpxP/1QbonNKvoXglLIyufCPLCGWLT8VyUNRc=; b=LeHCPQipr55KAiqeBvQd5Wk4pEfdUYc9ByAmCSRIB2+wE3/CAx+pdQAlMdIwcfH2k3 PTslncDMtghi78fDRYBFkL9GwsvqUBQSOUBCChrsqEVLByIcQureemH72i/avQ8SvHPG m/Vid4EfCmbSqkODcC1o6awTYwoMIouT3V+z0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=InnhxhnpxP/1QbonNKvoXglLIyufCPLCGWLT8VyUNRc=; b=V2NrdXrcHlIPA87PYzfc9miD8ZxwtUb2pVLXXPwq0Oe9T9q/cqyK64QFGx/A4/uiGs aZ3teVTyhp5fTx4l3c5OgUUnGqcia2QwLTmtO+qNzMcPhuTbGLfChsAokHptiASTFbB4 BvPx63m9A+jtLp+sSTn/4IliXcWzH9u2CWKPRWsAoTYnUmkod62eiEE28ygCj1B0n704 VNFoh8sJs9Xo5ANXWOU29NUe5wYz6X3ny2yGxpAI/ZRHD5VkYPBUwMsGeXFybRLjTfrW irJT0u379fb8JzFzzGSujY56rcfPTgpjmWG/ufFfQ2BhcVIJeewGNOfG0XvJFfDghsgp 53MQ== X-Gm-Message-State: ALyK8tLmJ0LKVScp/NqI4vRAzZak0UiAlowgVJCrJ0PDJMxZEURT1bXYjVevZ962tYE2p2z7 X-Received: by 10.157.19.109 with SMTP id q42mr3122802otq.80.1464996347866; Fri, 03 Jun 2016 16:25:47 -0700 (PDT) Received: from localhost ([2602:306:c558:19b0:a575:d8f4:7700:e330]) by smtp.gmail.com with ESMTPSA id 59sm4393611otl.30.2016.06.03.16.25.47 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 03 Jun 2016 16:25:47 -0700 (PDT) From: Andy Gross To: linux-arm-msm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bjorn Andersson , Stephen Boyd , devicetree@vger.kernel.org, jilai wang , Andy Gross , Andy Gross Subject: [Patch v6 04/10] firmware: qcom: scm: Generalize shared error map Date: Fri, 3 Jun 2016 18:25:24 -0500 Message-Id: <1464996330-16952-5-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464996330-16952-1-git-send-email-andy.gross@linaro.org> References: <1464996330-16952-1-git-send-email-andy.gross@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 Acked-by: Bjorn Andersson Signed-off-by: Andy Gross Signed-off-by: Andy Gross --- drivers/firmware/qcom_scm-32.c | 17 ----------------- drivers/firmware/qcom_scm.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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