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

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

Merge "usb: gadget: f_qdss: Allocate one string ID for all instances"

parents 0ffeb805 703211f0
Loading
Loading
Loading
Loading
+16 −11
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*
 * f_qdss.c -- QDSS function Driver
 *
 * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/init.h>
@@ -415,11 +415,13 @@ static int qdss_bind(struct usb_configuration *c, struct usb_function *f)
	qdss_data_intf_desc.bInterfaceNumber = iface;
	qdss->data_iface_id = iface;

	if (!qdss_string_defs[QDSS_DATA_IDX].id) {
		id = usb_string_id(c->cdev);
		if (id < 0)
			return id;
		qdss_string_defs[QDSS_DATA_IDX].id = id;
		qdss_data_intf_desc.iInterface = id;
	}

	if (qdss->debug_inface_enabled) {
		/* Allocate ctrl I/F */
@@ -430,12 +432,15 @@ static int qdss_bind(struct usb_configuration *c, struct usb_function *f)
		}
		qdss_ctrl_intf_desc.bInterfaceNumber = iface;
		qdss->ctrl_iface_id = iface;

		if (!qdss_string_defs[QDSS_CTRL_IDX].id) {
			id = usb_string_id(c->cdev);
			if (id < 0)
				return id;
			qdss_string_defs[QDSS_CTRL_IDX].id = id;
			qdss_ctrl_intf_desc.iInterface = id;
		}
	}

	/* for non-accelerated path keep tx fifo size 1k */
	if (!strcmp(qdss->ch.name, USB_QDSS_CH_MDM))