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

Commit a75fd8ba authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Greg Kroah-Hartman
Browse files

greybus: es2: Reserve CPorts 16 and 17



CPorts 16 and 17 are reserved for CDSI0 and CDSI1 by the ES2 APB, make
sure they won't be allocated dynamically.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 5626e0bf
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -841,6 +841,7 @@ static int ap_probe(struct usb_interface *interface,
	int retval = -ENOMEM;
	int i;
	int num_cports;
	int cport_id;

	udev = usb_get_dev(interface_to_usbdev(interface));

@@ -859,6 +860,14 @@ static int ap_probe(struct usb_interface *interface,
		return PTR_ERR(hd);
	}

	/*
	 * CPorts 16 and 17 are reserved for CDSI0 and CDSI1, make sure they
	 * won't be allocated dynamically.
	 */
	do {
		cport_id = ida_simple_get(&hd->cport_id_map, 16, 18, GFP_KERNEL);
	} while (cport_id > 0);

	es2 = hd_to_es2(hd);
	es2->hd = hd;
	es2->usb_intf = interface;