summaryrefslogtreecommitdiffstats
path: root/net/qrtr/smd.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2016-05-13 23:36:11 +0200
committerBjorn Andersson <bjorn.andersson@linaro.org>2016-05-13 23:42:23 +0200
commitf79a917e69e1f5cd86e864b67f06147f1b0340f4 (patch)
tree561675103ee8a220365e7c907e51d6c362727ff7 /net/qrtr/smd.c
parentudp: Resolve NULL pointer dereference over flow-based vxlan device (diff)
parentsoc: qcom: smd: Make callback pass channel reference (diff)
downloadlinux-f79a917e69e1f5cd86e864b67f06147f1b0340f4.tar.xz
linux-f79a917e69e1f5cd86e864b67f06147f1b0340f4.zip
Merge tag 'qcom-soc-for-4.7-2' into net-next
This merges the Qualcomm SOC tree with the net-next, solving the merge conflict in the SMD API between the two. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'net/qrtr/smd.c')
-rw-r--r--net/qrtr/smd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/qrtr/smd.c b/net/qrtr/smd.c
index 84ebce73aa23..0d11132b3370 100644
--- a/net/qrtr/smd.c
+++ b/net/qrtr/smd.c
@@ -21,13 +21,14 @@
struct qrtr_smd_dev {
struct qrtr_endpoint ep;
struct qcom_smd_channel *channel;
+ struct device *dev;
};
/* from smd to qrtr */
-static int qcom_smd_qrtr_callback(struct qcom_smd_device *sdev,
+static int qcom_smd_qrtr_callback(struct qcom_smd_channel *channel,
const void *data, size_t len)
{
- struct qrtr_smd_dev *qdev = dev_get_drvdata(&sdev->dev);
+ struct qrtr_smd_dev *qdev = qcom_smd_get_drvdata(channel);
int rc;
if (!qdev)
@@ -35,7 +36,7 @@ static int qcom_smd_qrtr_callback(struct qcom_smd_device *sdev,
rc = qrtr_endpoint_post(&qdev->ep, data, len);
if (rc == -EINVAL) {
- dev_err(&sdev->dev, "invalid ipcrouter packet\n");
+ dev_err(qdev->dev, "invalid ipcrouter packet\n");
/* return 0 to let smd drop the packet */
rc = 0;
}
@@ -73,12 +74,14 @@ static int qcom_smd_qrtr_probe(struct qcom_smd_device *sdev)
return -ENOMEM;
qdev->channel = sdev->channel;
+ qdev->dev = &sdev->dev;
qdev->ep.xmit = qcom_smd_qrtr_send;
rc = qrtr_endpoint_register(&qdev->ep, QRTR_EP_NID_AUTO);
if (rc)
return rc;
+ qcom_smd_set_drvdata(sdev->channel, qdev);
dev_set_drvdata(&sdev->dev, qdev);
dev_dbg(&sdev->dev, "Qualcomm SMD QRTR driver probed\n");