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

Commit 59f08e6d authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi
Browse files

usb: dummy_hcd: use usb_endpoint_type()



This patch makes use of usb_endpoint_type() instead of the open coding.

Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a54c979f
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -447,7 +447,7 @@ dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
	 * especially for "ep9out" style fixed function ones.)
	 * especially for "ep9out" style fixed function ones.)
	 */
	 */
	retval = -EINVAL;
	retval = -EINVAL;
	switch (desc->bmAttributes & 0x03) {
	switch (usb_endpoint_type(desc)) {
	case USB_ENDPOINT_XFER_BULK:
	case USB_ENDPOINT_XFER_BULK:
		if (strstr (ep->ep.name, "-iso")
		if (strstr (ep->ep.name, "-iso")
				|| strstr (ep->ep.name, "-int")) {
				|| strstr (ep->ep.name, "-int")) {
@@ -531,7 +531,7 @@ dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
		desc->bEndpointAddress & 0x0f,
		desc->bEndpointAddress & 0x0f,
		(desc->bEndpointAddress & USB_DIR_IN) ? "in" : "out",
		(desc->bEndpointAddress & USB_DIR_IN) ? "in" : "out",
		({ char *val;
		({ char *val;
		 switch (desc->bmAttributes & 0x03) {
		 switch (usb_endpoint_type(desc)) {
		 case USB_ENDPOINT_XFER_BULK:
		 case USB_ENDPOINT_XFER_BULK:
			 val = "bulk";
			 val = "bulk";
			 break;
			 break;
@@ -1439,7 +1439,7 @@ static int periodic_bytes (struct dummy *dum, struct dummy_ep *ep)
		limit += limit * tmp;
		limit += limit * tmp;
	}
	}
	if (dum->gadget.speed == USB_SPEED_SUPER) {
	if (dum->gadget.speed == USB_SPEED_SUPER) {
		switch (ep->desc->bmAttributes & 0x03) {
		switch (usb_endpoint_type(ep->desc)) {
		case USB_ENDPOINT_XFER_ISOC:
		case USB_ENDPOINT_XFER_ISOC:
			/* Sec. 4.4.8.2 USB3.0 Spec */
			/* Sec. 4.4.8.2 USB3.0 Spec */
			limit = 3 * 16 * 1024 * 8;
			limit = 3 * 16 * 1024 * 8;