[PATCH 1/4] USB gadget: at91: return error when no udc is registered
Sascha Hauer
s.hauer at pengutronix.de
Thu Feb 13 04:42:50 EST 2014
When no udc is registered it is clearly an error when usb_gadget_poll
is called. Let the upper layers know that.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/usb/gadget/at91_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 6eeef7d..8ef1ad0 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1327,7 +1327,7 @@ int usb_gadget_poll(void)
u32 value;
if (!udc->udp_baseaddr)
- return 0;
+ return -ENODEV;
value = gpio_get_value(udc->board.vbus_pin);
value ^= udc->board.vbus_active_low;
--
1.8.5.3
More information about the barebox
mailing list