diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2016-05-06 17:09:07 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-09 06:46:14 +0300 |
commit | 43315f31adc2bf3b35e04dcf2372c3bb08014ed1 (patch) | |
tree | dad4d0b403d238c415fe49d9daf82e5c1e429e56 /include/linux/soc | |
parent | 218d48e701f08a71df57c410e596e30b3285bd25 (diff) | |
download | linux-43315f31adc2bf3b35e04dcf2372c3bb08014ed1.tar.xz |
soc: qcom: smd: Introduce compile stubs
Introduce compile stubs for the SMD API, allowing consumers to be
compile tested.
Acked-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/soc')
-rw-r--r-- | include/linux/soc/qcom/smd.h | 28 |
1 files changed, 27 insertions, 1 deletions
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 |