aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/MassStorageHost
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-05-15 08:02:30 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-05-15 08:02:30 +0000
commit76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba (patch)
tree3d21b280a0648adcf2f3d66b9e3fa5c0c00c7f6e /Demos/Host/MassStorageHost
parentfabfdd454a11440a5789a70f6476889b02928438 (diff)
downloadlufa-76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba.tar.gz
lufa-76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba.tar.bz2
lufa-76d5e99bb8765030a7f99e7b5adf9bae7f92e0ba.zip
Fix to previous patch (make CDCHost demo deallocate pipes when an invalid CDC interface is skipped).
Remove the saving of the USB_GetNextDescriptorComp() return value in all host demos, since it went unused anyway; replaced with a simple check against the success error code for clarity.
Diffstat (limited to 'Demos/Host/MassStorageHost')
-rw-r--r--Demos/Host/MassStorageHost/ConfigDescriptor.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Demos/Host/MassStorageHost/ConfigDescriptor.c b/Demos/Host/MassStorageHost/ConfigDescriptor.c
index 6642e1c5c..c02f3b0de 100644
--- a/Demos/Host/MassStorageHost/ConfigDescriptor.c
+++ b/Demos/Host/MassStorageHost/ConfigDescriptor.c
@@ -49,7 +49,6 @@ uint8_t ProcessConfigurationDescriptor(void)
{
uint8_t* ConfigDescriptorData;
uint16_t ConfigDescriptorSize;
- uint8_t ErrorCode;
uint8_t FoundEndpoints = 0;
/* Get Configuration Descriptor size from the device */
@@ -71,8 +70,8 @@ uint8_t ProcessConfigurationDescriptor(void)
return InvalidConfigDataReturned;
/* Get the mass storage interface from the configuration descriptor */
- if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
- NextMassStorageInterface)))
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextMassStorageInterface) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoInterfaceFound;
@@ -82,8 +81,8 @@ uint8_t ProcessConfigurationDescriptor(void)
while (FoundEndpoints != ((1 << MASS_STORE_DATA_IN_PIPE) | (1 << MASS_STORE_DATA_OUT_PIPE)))
{
/* Fetch the next bulk endpoint from the current mass storage interface */
- if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
- NextInterfaceBulkDataEndpoint)))
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ NextInterfaceBulkDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
{
/* Descriptor not found, error out */
return NoEndpointFound;