From patchwork Wed May 11 14:15:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 9071111 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EA0809F30C for ; Wed, 11 May 2016 14:19:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 111B8201BB for ; Wed, 11 May 2016 14:19:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20FBB2012D for ; Wed, 11 May 2016 14:19:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751675AbcEKOTZ (ORCPT ); Wed, 11 May 2016 10:19:25 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:33568 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932163AbcEKOR6 (ORCPT ); Wed, 11 May 2016 10:17:58 -0400 Received: by mail-oi0-f54.google.com with SMTP id v145so69534503oie.0 for ; Wed, 11 May 2016 07:17: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=InnhxhnpxP/1QbonNKvoXglLIyufCPLCGWLT8VyUNRc=; b=MQkuNBW8ZlDDfzF8PtGt5cwXBKx6znC4oAhp9Qtzo3DnrPVM5sIOP+Dx6Nx06BAAm4 nVKGA7vbiJ0WmcFwn0XQMsJsvk8oHfzw4yBb2Q3zdO5nA7GQYWr1J3NfPXb/H8SSf3mb 9dzlfvA/OvshIlMyoz39PRdx/F3O2sXbTCpgo= 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=ZyC41iljPgxwwwhhSc7IBCv93VX5tvnXbbI5habFCV/AvsZFndhDb3pupd7LLIYC5b rflM3zo+YN/KpczdeCZfESnznVWIxUXLtBNkEVzTdsTXa9dEukYDqTJvYL5GMGe0/Lls cmsivbqPWw3AqjnwoX6wSZHvj9aoRQ36teK7b60IWqNPTSzKwws7aO1poeqC7rgM64Dc 1ehg9+C44phxQvHdSi+PW0dYOpwxxhxiEAJx/Q2PhhJxHiONYKVEFkYXqMZtosGpnRup r5UysLQcvTdmhaI1EYmhlzwwdASoRQIvoy1CZs5cXHZ3fwx0CCA1Y5HQmm8ZaWFL07K+ 561g== X-Gm-Message-State: AOPr4FXe2Ox5JnQ6CPo16fGC4yuMm8gNi8CL9L2z4ap7YLN+yXeLIxo8VowVZBEsTwa9LK5u X-Received: by 10.157.49.1 with SMTP id e1mr2243307otc.148.1462976277623; Wed, 11 May 2016 07:17:57 -0700 (PDT) Received: from localhost ([2602:306:c558:19b0:68a6:b401:fd49:9ae6]) by smtp.gmail.com with ESMTPSA id 5sm2180159otg.27.2016.05.11.07.17.57 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 11 May 2016 07:17:57 -0700 (PDT) From: Andy Gross To: linux-arm-msm@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Stephen Boyd , jilai wang , Andy Gross , Andy Gross Subject: [Patch v4 4/8] firmware: qcom: scm: Generalize shared error map Date: Wed, 11 May 2016 09:15:54 -0500 Message-Id: <1462976158-26016-5-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1462976158-26016-1-git-send-email-andy.gross@linaro.org> References: <1462976158-26016-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-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.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