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: 67543 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp251399qge; Wed, 11 May 2016 07:19:29 -0700 (PDT) X-Received: by 10.66.118.166 with SMTP id kn6mr5296148pab.33.1462976369158; Wed, 11 May 2016 07:19:29 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si9907659pfd.171.2016.05.11.07.19.28; Wed, 11 May 2016 07:19:29 -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 S932535AbcEKOT0 (ORCPT + 29 others); Wed, 11 May 2016 10:19:26 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:36126 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932160AbcEKOR6 (ORCPT ); Wed, 11 May 2016 10:17:58 -0400 Received: by mail-oi0-f47.google.com with SMTP id x201so69638310oif.3 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=Dgn5wx3kxeRdOGZcZFL2CgCOOVBZF7gKR+qdRrhb/beBrepNwTD6nRSycXpENybrxp ugw2eCrwkC5XpJbR+RCuPNMXTN/046utreEtwAMkJzChkGGk1xPuSRmwBtwGz9keUq0t xkf/WsAL8lwjzl8OD6hjS46JORMdrdGBfYIuoYBhYDFPoitX6g15SrWhua1e7C3YbvZg I0P8R6IhtyiHEMqVabBoenBV4cDbffjB+Ta5No2iw7Io99KhF+9SUt5+lSvcrL5/nl+V qQP3b7hwDx1nhpyrrdyyHTEn5vmb6afujJZd2/IvfllmYIwJDRfWffvYpCwwpyZaEP+L QCQw== X-Gm-Message-State: AOPr4FXeZ4tz9TgmwlM4kySTM2QS8qgoJ1r91flgFCFf7iz0wp2GCYwsMeRY9Op6H2TmfQqK 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-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. 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 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