Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80397065 authored by Chris Lew's avatar Chris Lew Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: glink_pkt: Fix priv data for rpmsg cb



Use the device driver private helper to get the glink packet device
from the rpmsg callback instead of using the private variable from
the callback.

Change-Id: I27398995c8372021c631f082639a35c338ca134c
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 9bcf1266
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ enum {
#define GLINK_PKT_INFO(x, ...)						\
do {									\
	if (glink_pkt_debug_mask & GLINK_PKT_INFO) {			\
		pr_info("[%s]: "x, __func__, ##__VA_ARGS__);		\
		ipc_log_string(glink_pkt_ilctxt,			\
			"[%s]: "x, __func__, ##__VA_ARGS__);		\
	}								\
@@ -182,6 +181,7 @@ static int glink_pkt_rpdev_probe(struct rpmsg_device *rpdev)
	gpdev->rpdev = rpdev;
	mutex_unlock(&gpdev->lock);

	dev_set_drvdata(&rpdev->dev, gpdev);
	complete_all(&gpdev->ch_open);

	return 0;
@@ -190,7 +190,7 @@ static int glink_pkt_rpdev_probe(struct rpmsg_device *rpdev)
static int glink_pkt_rpdev_cb(struct rpmsg_device *rpdev, void *buf, int len,
			      void *priv, u32 addr)
{
	struct glink_pkt_device *gpdev = priv;
	struct glink_pkt_device *gpdev = dev_get_drvdata(&rpdev->dev);
	unsigned long flags;
	struct sk_buff *skb;

@@ -237,6 +237,8 @@ static void glink_pkt_rpdev_remove(struct rpmsg_device *rpdev)
	gpdev->rpdev = NULL;
	mutex_unlock(&gpdev->lock);

	dev_set_drvdata(&rpdev->dev, NULL);

	/* wake up any blocked readers */
	reinit_completion(&gpdev->ch_open);
	wake_up_interruptible(&gpdev->readq);