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

Commit 3e065b68 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: gadget: Fix support for 2 serial ports over char_bridge



Currently, u_data_bridge driver specifies that we can
have 2 port instances supported over it. But there is
a bug in the setup function to check the number of ports.
Fix the bug and also add corresponding port_num support
in f_serial driver.

Change-Id: I564914ff737bee8bd89e08153190d65219d002cd
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent a70fb461
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1196,6 +1196,7 @@ int gserial_init_port(int port_num, const char *name,
		no_smd_ports++;
		break;
	case USB_GADGET_XPORT_CHAR_BRIDGE:
		gserial_ports[port_num].client_port_num = no_char_bridge_ports;
		no_char_bridge_ports++;
		break;
	case USB_GADGET_XPORT_HSIC:
+1 −1
Original line number Diff line number Diff line
@@ -888,7 +888,7 @@ static void gbridge_debugfs_init(void) {}
int gbridge_setup(void *gptr, u8 no_ports)
{
	pr_debug("gptr:%pK, no_bridge_ports:%d\n", gptr, no_ports);
	if (no_ports >= num_of_instance) {
	if (no_ports > num_of_instance) {
		pr_err("More ports are requested\n");
		return -EINVAL;
	}