soc: qcom: smd: Introduce callback setter

Introduce a setter for the callback function pointer to clarify the
locking around the operation and to reduce some duplication.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This commit is contained in:
Bjorn Andersson 2016-02-17 22:39:02 -08:00 committed by Andy Gross
parent 3b904b046c
commit 39f0db298e
2 changed files with 20 additions and 9 deletions

View file

@ -26,6 +26,8 @@ struct qcom_smd_device {
struct qcom_smd_channel *channel;
};
typedef int (*qcom_smd_cb_t)(struct qcom_smd_device *, const void *, size_t);
/**
* struct qcom_smd_driver - smd driver struct
* @driver: underlying device driver
@ -42,7 +44,7 @@ struct qcom_smd_driver {
int (*probe)(struct qcom_smd_device *dev);
void (*remove)(struct qcom_smd_device *dev);
int (*callback)(struct qcom_smd_device *, const void *, size_t);
qcom_smd_cb_t callback;
};
int qcom_smd_driver_register(struct qcom_smd_driver *drv);