Skip to content

Commit 43315f3

Browse files
anderssondavem330
authored andcommitted
soc: qcom: smd: Introduce compile stubs
Introduce compile stubs for the SMD API, allowing consumers to be compile tested. Acked-by: Andy Gross <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 218d48e commit 43315f3

File tree

1 file changed

+27
-1
lines changed
  • include/linux/soc/qcom

1 file changed

+27
-1
lines changed

include/linux/soc/qcom/smd.h

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,39 @@ struct qcom_smd_driver {
4545
int (*callback)(struct qcom_smd_device *, const void *, size_t);
4646
};
4747

48+
#if IS_ENABLED(CONFIG_QCOM_SMD)
49+
4850
int qcom_smd_driver_register(struct qcom_smd_driver *drv);
4951
void qcom_smd_driver_unregister(struct qcom_smd_driver *drv);
5052

53+
int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len);
54+
55+
#else
56+
57+
static inline int qcom_smd_driver_register(struct qcom_smd_driver *drv)
58+
{
59+
return -ENXIO;
60+
}
61+
62+
static inline void qcom_smd_driver_unregister(struct qcom_smd_driver *drv)
63+
{
64+
/* This shouldn't be possible */
65+
WARN_ON(1);
66+
}
67+
68+
static inline int qcom_smd_send(struct qcom_smd_channel *channel,
69+
const void *data, int len)
70+
{
71+
/* This shouldn't be possible */
72+
WARN_ON(1);
73+
return -ENXIO;
74+
}
75+
76+
#endif
77+
5178
#define module_qcom_smd_driver(__smd_driver) \
5279
module_driver(__smd_driver, qcom_smd_driver_register, \
5380
qcom_smd_driver_unregister)
5481

55-
int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len);
5682

5783
#endif

0 commit comments

Comments
 (0)