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

Commit bfb7fb79 authored by Wojtek Kaniewski's avatar Wojtek Kaniewski Committed by Greg Kroah-Hartman
Browse files

USB: at91_udc: Additional checks



This patch performs additional checks in at91_udc, just in case of
some spurious interrupts or device enumeration.

Signed-off-by: default avatarWojtek Kaniewski <wojtekka@toxygen.net>
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 943c4419
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -955,7 +955,10 @@ static int at91_vbus_session(struct usb_gadget *gadget, int is_active)
	// VDBG("vbus %s\n", is_active ? "on" : "off");
	local_irq_save(flags);
	udc->vbus = (is_active != 0);
	if (udc->driver)
		pullup(udc, is_active);
	else
		pullup(udc, 0);
	local_irq_restore(flags);
	return 0;
}
@@ -1241,7 +1244,10 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr)
#undef w_length

	/* pass request up to the gadget driver */
	if (udc->driver)
		status = udc->driver->setup(&udc->gadget, &pkt.r);
	else
		status = -ENODEV;
	if (status < 0) {
stall:
		VDBG("req %02x.%02x protocol STALL; stat %d\n",