You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by bt...@apache.org on 2020/11/13 05:44:16 UTC
[incubator-nuttx] 02/02: usbdev: adb: fix missing break
This is an automated email from the ASF dual-hosted git repository.
btashton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit da70eb5c56e9f0401bb13b8ecf18e50d31741a33
Author: Simon Piriou <sp...@gmail.com>
AuthorDate: Wed Oct 28 02:28:33 2020 +0100
usbdev: adb: fix missing break
---
drivers/usbdev/adb.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/usbdev/adb.c b/drivers/usbdev/adb.c
index 28423f9..d9ceb3c 100644
--- a/drivers/usbdev/adb.c
+++ b/drivers/usbdev/adb.c
@@ -1157,6 +1157,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
{
#ifndef CONFIG_USBADB_COMPOSITE
case USB_REQ_GETDESCRIPTOR:
+ {
/* The value field specifies the descriptor type in the
* MS byte and the descriptor index in the LS byte
* (order is little endian)
@@ -1216,6 +1217,8 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
}
break;
}
+ }
+ break;
/* If the serial device is used in as part of a composite device,
* then the overall composite class configuration is managed by
@@ -1267,13 +1270,6 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
}
#ifndef CONFIG_USBADB_COMPOSITE
-
- /* Composite should send only one resquest for USB_REQ_SETCONFIGURATION.
- * Hence ADB driver cannot submit to ep0; composite has to handle it.
- */
-
- #warning composite_ep0submit() seems broken so skip it in case of composite
-
/* Respond to the setup command if data was returned. On an error return
* value (ret < 0), the USB driver will stall.
*/
@@ -1297,6 +1293,12 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
usbclass_ep0incomplete(dev->ep0, ctrlreq);
}
}
+#else
+ /* Composite should send only one resquest for USB_REQ_SETCONFIGURATION.
+ * Hence ADB driver cannot submit to ep0; composite has to handle it.
+ */
+
+ #warning composite_ep0submit() seems broken so skip it in case of composite
#endif /* !CONFIG_USBADB_COMPOSITE */
/* Returning a negative value will cause a STALL */