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: 9154291 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F36E60751 for ; Fri, 3 Jun 2016 23:27:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5081E28334 for ; Fri, 3 Jun 2016 23:27:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4525928345; Fri, 3 Jun 2016 23:27:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF23628334 for ; Fri, 3 Jun 2016 23:27:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750967AbcFCX1K (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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