netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] soc: qcom: smd: Introduce compile stubs
@ 2016-04-27 19:13 Bjorn Andersson
  2016-04-27 19:13 ` [PATCH v3 2/2] net: Add Qualcomm IPC router Bjorn Andersson
  2016-04-27 19:32 ` [PATCH v3 1/2] soc: qcom: smd: Introduce compile stubs Andy Gross
  0 siblings, 2 replies; 4+ messages in thread
From: Bjorn Andersson @ 2016-04-27 19:13 UTC (permalink / raw)
  To: David S. Miller, Andy Gross; +Cc: linux-kernel, netdev, linux-arm-msm

Introduce compile stubs for the SMD API, allowing consumers to be
compile tested.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

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(-)

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
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-28 21:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-27 19:13 [PATCH v3 1/2] soc: qcom: smd: Introduce compile stubs Bjorn Andersson
2016-04-27 19:13 ` [PATCH v3 2/2] net: Add Qualcomm IPC router Bjorn Andersson
2016-04-28 21:19   ` David Miller
2016-04-27 19:32 ` [PATCH v3 1/2] soc: qcom: smd: Introduce compile stubs Andy Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).