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

Commit 8b1bc52a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qdss_bridge: Add status check in usb_notifier"

parents 801bada2 90976938
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1354,6 +1354,14 @@ void usb_notifier(void *priv, unsigned int event, struct qdss_request *d_req,
	int ret = 0;

	mutex_lock(&drvdata->mem_lock);
	if (drvdata->out_mode != TMC_ETR_OUT_MODE_USB
			|| drvdata->mode == CS_MODE_DISABLED) {
		dev_err(&drvdata->csdev->dev,
		"%s: ETR is not USB mode, or ETR is disabled.\n", __func__);
		mutex_unlock(&drvdata->mem_lock);
		return;
	}

	if (event == USB_QDSS_CONNECT) {
		ret = tmc_etr_fill_usb_bam_data(drvdata);
		if (ret)
+5 −1
Original line number Diff line number Diff line
@@ -449,8 +449,12 @@ static void usb_notifier(void *priv, unsigned int event,
{
	struct qdss_bridge_drvdata *drvdata = priv;

	if (!drvdata)
	if (!drvdata || drvdata->mode != MHI_TRANSFER_TYPE_USB
			|| drvdata->opened == DISABLE) {
		pr_err_ratelimited("%s can't be called in invalid status.\n",
				__func__);
		return;
	}

	switch (event) {
	case USB_QDSS_CONNECT: