From patchwork Mon Apr 25 23:08:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 66647 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1300214qge; Mon, 25 Apr 2016 16:09:24 -0700 (PDT) X-Received: by 10.66.172.165 with SMTP id bd5mr167922pac.128.1461625764390; Mon, 25 Apr 2016 16:09:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k68si584251pfb.102.2016.04.25.16.09.24; Mon, 25 Apr 2016 16:09:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752288AbcDYXJE (ORCPT + 29 others); Mon, 25 Apr 2016 19:09:04 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:34860 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbcDYXI6 (ORCPT ); Mon, 25 Apr 2016 19:08:58 -0400 Received: by mail-oi0-f51.google.com with SMTP id x19so59089113oix.2 for ; Mon, 25 Apr 2016 16:08:58 -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=IvSKIfEHJAA0Go9rlLjIR830E2oJo0RCef76hrmmuqA=; b=CrBMrbTQsfOGt3WlHOFpvy4UiZGlcughaZcjmXY5b6zKOX6/VR4wtLHPy5fK5WKcbm 8UXd8+eUXFWqgeGy6PmYs1c253yW9HaSuVULTZXEGmql8HpCINNzqgyEiMsynj03BD/Y eoVAKSLj6FXy90iMZx7UShWAew5F6cYzySWR0= 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=IvSKIfEHJAA0Go9rlLjIR830E2oJo0RCef76hrmmuqA=; b=OBJ62KmpJ1PQO6JKofeYJs5EGeFojhIwSpNytyDCehBU1RcKaJIMDjTSbr7wjIjPpB tNbfakT6A54gBDmZovV+ZcHOn6v/1/GCRJUcBppA10kxga+gbniAss/3vZAr102w8rw4 IsDUxSfve3a0Lt1cmtoj5aKEpKyI8EnhXJEJeB9s3rUVmPTyMIOy3GxVnjSZh9K933XZ fd/aOUtiignQ40LCmsGFQFajQTJvAoDppXy4wZGUZMy775TviJWic7h1ukiY7ILFaG2R amL/snQfUTVS+91XOMaur3NmmHsivjM27iDcrY2r1FyOagqQYGAiswczIl62V8w2K8Ah tH9Q== X-Gm-Message-State: AOPr4FVQH6Q84kjzntTHgiRFkEMAnJSo610Q6jj5L4DCrTy+Z0Gr9PyMm24+NdvQfC3gkXxm X-Received: by 10.202.200.66 with SMTP id y63mr13614112oif.92.1461625737423; Mon, 25 Apr 2016 16:08:57 -0700 (PDT) Received: from localhost ([2602:306:c558:19b0:396f:541d:66bc:56f0]) by smtp.gmail.com with ESMTPSA id t92sm7119202otb.14.2016.04.25.16.08.56 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 25 Apr 2016 16:08:57 -0700 (PDT) From: Andy Gross To: linux-arm-msm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, jilai wang , Stephen Boyd , Andy Gross , Andy Gross Subject: [Patch v2 3/8] firmware: qcom: scm: Generalize shared error map Date: Mon, 25 Apr 2016 18:08:40 -0500 Message-Id: <1461625725-32425-4-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461625725-32425-1-git-send-email-andy.gross@linaro.org> References: <1461625725-32425-1-git-send-email-andy.gross@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. 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 diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c index 0883292..9e3dc2f 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