From patchwork Wed May 4 22:50:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 9019341 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 78A179F39D for ; Wed, 4 May 2016 22:52:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86C482041A for ; Wed, 4 May 2016 22:52:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 94C44203EC for ; Wed, 4 May 2016 22:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755074AbcEDWw0 (ORCPT ); Wed, 4 May 2016 18:52:26 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:35153 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754591AbcEDWuz (ORCPT ); Wed, 4 May 2016 18:50:55 -0400 Received: by mail-oi0-f52.google.com with SMTP id x19so83697516oix.2 for ; Wed, 04 May 2016 15:50:55 -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=flCC9P2woWaWlu4/n11Ag4hRCzFpLiRtFXukHnw4KtiM7gH1ZAirX9k4b2g7kxaEY7 HFMyZDBZhKSE3heTJKpPzBEFrtKCZMVVGZkRhesnNe2XK8xYz91/KY6HlE2XIvvq33D1 HuaNI2CV2661tBMfIJa1rikjjMt9yCF3BSTAU= 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=lwa24hg9pLK3q/YIFthZ1cXZFWUt1TOiMCcFub6AgX1QM3B4zH3CgEBEMMx0OGb8uW u9nu9RjRjoJsU+YSAuUa22gOwYhXElzrsWshfhhfaC8QN+IZ8gXDJrOk2ea3mvxmMDnv qLMIKOtkQ8PV2fXDvLYaMDWMZbsG8BOeMc6d0F7lhQOebgb408/I6kKQlDdkakC4PxkX rjpRu48NbULTsueglbi0ZgdJlmqzR41+4MtrkvEjmdi7NeBvww7rF2MC0L9a3hSffbGa dZvnOIza5w+E7wQSw7nT4wOZ+p3h1zkzffHZnzyeIlGn/oycEjQq0R7vkztS1FIspZk8 LfjA== X-Gm-Message-State: AOPr4FUujSVRK8/PTyj+IdaqvsztSEAsyCywwgyjBj9g0WNZkFPNPfi0ADlMTIDHItm9ONbP X-Received: by 10.157.37.73 with SMTP id j9mr5666799otd.177.1462402254893; Wed, 04 May 2016 15:50:54 -0700 (PDT) Received: from localhost ([2602:306:c558:19b0:7540:9cc9:16d9:58a9]) by smtp.gmail.com with ESMTPSA id 93sm2201492otf.9.2016.05.04.15.50.54 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 04 May 2016 15:50:54 -0700 (PDT) From: Andy Gross To: linux-arm-msm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stephen Boyd , Bjorn Andersson , jilai wang , devicetree@vger.kernel.org, Andy Gross , Andy Gross Subject: [Patch v3 4/8] firmware: qcom: scm: Generalize shared error map Date: Wed, 4 May 2016 17:50:41 -0500 Message-Id: <1462402245-18295-5-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1462402245-18295-1-git-send-email-andy.gross@linaro.org> References: <1462402245-18295-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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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