From patchwork Wed Apr 27 19:13:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 66828 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2363459qge; Wed, 27 Apr 2016 12:13:25 -0700 (PDT) X-Received: by 10.98.65.203 with SMTP id g72mr14522940pfd.138.1461784404037; Wed, 27 Apr 2016 12:13:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xs13si6712633pac.140.2016.04.27.12.13.23; Wed, 27 Apr 2016 12:13:24 -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 S1752666AbcD0TNH (ORCPT + 8 others); Wed, 27 Apr 2016 15:13:07 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:34473 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbcD0TNG (ORCPT ); Wed, 27 Apr 2016 15:13:06 -0400 Received: by mail-pf0-f175.google.com with SMTP id y69so23847508pfb.1 for ; Wed, 27 Apr 2016 12:13:06 -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; bh=w0aFPVrFu9y+u3siAX/LvlU6Y+XGC9E6LuEf/9n+aXE=; b=HlHZaGXRSo2sJO2t3NN055d8gYl608QCDBbQ1tZxRo/As2SmFbvQrupKCLMPAGfUNN 6LNrenNJcPZtVn0VwXoj6hAi5YTbQarnYPUrod7XZ9RivvUxFBo5DLf0PHGNVrCdcnD0 GKb23kloXMklyJwTHYY4nnu17ujRleeD3Pym8= 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; bh=w0aFPVrFu9y+u3siAX/LvlU6Y+XGC9E6LuEf/9n+aXE=; b=L72Cq67bIsSnuoCbnSnVfsx5eqcN1/dO6NctEyjA5gv+uzZhhxllN1mPGWBFMzMFGZ jYRtZt2tDpIzUxg6UL8/mnVvv6jqgC0lRDpA4gjSIW63mYBdqVeJkrD6jNGxdxBlGwak /SPZL1ZHBuJJ5tFJ0gIkzySuzPeW2gl9gqqnkLrzrHwzwZf7GOZvlGCFVWjIeKHlTQBF OFuVehKlDv3ssiumE+CO/c1WGWMCkXPZmhsOXsK4xOS4395x9UpXGHh6mA+f5NZ/PEVd e/mSaYfUZ9DHn0UqRu2Qvy1K83ZtycvZZP8Zw7tDJAuWm6vkpGsGjsT39YrRKp56fhfq VerQ== X-Gm-Message-State: AOPr4FW5J8iAPErCqCL2+HrtKJtrHKDBJPXKS3R3MycmDveWwUGSVHmo3zS+6SM+mZ89PJu2 X-Received: by 10.98.91.3 with SMTP id p3mr14489294pfb.64.1461784385439; Wed, 27 Apr 2016 12:13:05 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id p1sm10037080paz.8.2016.04.27.12.13.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Apr 2016 12:13:04 -0700 (PDT) From: Bjorn Andersson To: "David S. Miller" , Andy Gross Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v3 1/2] soc: qcom: smd: Introduce compile stubs Date: Wed, 27 Apr 2016 12:13:02 -0700 Message-Id: <1461784383-2978-1-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Introduce compile stubs for the SMD API, allowing consumers to be compile tested. Signed-off-by: Bjorn Andersson --- Changes since v2: - Introduce this patch, to allow compile testing of QRTR_SMD include/linux/soc/qcom/smd.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) -- 2.5.0 -- 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 Acked-by: Andy Gross diff --git a/include/linux/soc/qcom/smd.h b/include/linux/soc/qcom/smd.h index d0cb6d189a0a..46a984f5e3a3 100644 --- a/include/linux/soc/qcom/smd.h +++ b/include/linux/soc/qcom/smd.h @@ -45,13 +45,39 @@ struct qcom_smd_driver { int (*callback)(struct qcom_smd_device *, const void *, size_t); }; +#if IS_ENABLED(CONFIG_QCOM_SMD) + int qcom_smd_driver_register(struct qcom_smd_driver *drv); void qcom_smd_driver_unregister(struct qcom_smd_driver *drv); +int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len); + +#else + +static inline int qcom_smd_driver_register(struct qcom_smd_driver *drv) +{ + return -ENXIO; +} + +static inline void qcom_smd_driver_unregister(struct qcom_smd_driver *drv) +{ + /* This shouldn't be possible */ + WARN_ON(1); +} + +static inline int qcom_smd_send(struct qcom_smd_channel *channel, + const void *data, int len) +{ + /* This shouldn't be possible */ + WARN_ON(1); + return -ENXIO; +} + +#endif + #define module_qcom_smd_driver(__smd_driver) \ module_driver(__smd_driver, qcom_smd_driver_register, \ qcom_smd_driver_unregister) -int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len); #endif