From patchwork Fri May 13 03:46:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 67717 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp59943qge; Thu, 12 May 2016 20:48:55 -0700 (PDT) X-Received: by 10.67.13.78 with SMTP id ew14mr18817191pad.127.1463111331560; Thu, 12 May 2016 20:48:51 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18si21920333pal.55.2016.05.12.20.48.51; Thu, 12 May 2016 20:48:51 -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 S1751502AbcEMDsO (ORCPT + 8 others); Thu, 12 May 2016 23:48:14 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:33644 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753242AbcEMDra (ORCPT ); Thu, 12 May 2016 23:47:30 -0400 Received: by mail-oi0-f48.google.com with SMTP id v145so151919293oie.0 for ; Thu, 12 May 2016 20:47:24 -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=bWxXUavb2HWLopiEXUSk3KbosADAmypQh1ujDy1wxuFRCCvQnNSRcOqVYXX9OJg9gB jsn2x5wi94LEs41EYMYUwnDxoN30wNkLxR6NYTXXNaxoilMpJlftt1Be9lb/6jpu+rWa h9mbOiBhnqap7+PbHuOZ0v1h1aeAUiH4qVq9I= 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=E0WEP090YVZ9JJ/4wFnzZlylFuFrv3cDczKjSkr0rckZ/I/6n21IhqRaFztHWC5Vqw z2mjyA0AWB5XgDTkHsY1YOQJ3i4yUb7MPPQSUmktY0kXaVCEbCx9rJgByW8800BvwSiW rduIwShuRnbJOIFa6RaK1a5AwlB/kNdOypmKlaC4IrjKUWtv/F1Hp/RkIOD/SimHWbD7 69tJhMs+eIFqv7+DpCj2AFbbXtzT3a600kqdgnSbFbS2C58Q41eBWxBDvurHDFWxk0ZX mieVS/t3vya4BSfuAvTRLXW2a5+A1Afppzzom+i3UlAl6TfT0gu6BVuvZ/XnHCggoId6 AhKg== X-Gm-Message-State: AOPr4FVTMxhmWs354JiozGTt76iZC4adKYFzdPw8znrCJH5nJ0IO+sJ22QnEAAKugoc7Drzt X-Received: by 10.202.73.146 with SMTP id w140mr2117291oia.80.1463111244448; Thu, 12 May 2016 20:47:24 -0700 (PDT) Received: from localhost (108-85-129-155.lightspeed.austtx.sbcglobal.net. [108.85.129.155]) by smtp.gmail.com with ESMTPSA id ut10sm4772197obc.19.2016.05.12.20.47.23 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 12 May 2016 20:47:24 -0700 (PDT) From: Andy Gross To: linux-arm-msm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Stephen Boyd , devicetree@vger.kernel.org, jilai wang , Andy Gross , Andy Gross Subject: [Patch v5 4/8] firmware: qcom: scm: Generalize shared error map Date: Thu, 12 May 2016 22:46:57 -0500 Message-Id: <1463111221-6963-5-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463111221-6963-1-git-send-email-andy.gross@linaro.org> References: <1463111221-6963-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