Kernel - Added return value to module cleanup, fixed LVM bugs
[tpg/acess2.git] / KernelLand / Modules / USB / Core / usb_lowlevel.c
index 67381c0..dce7c33 100644 (file)
@@ -5,7 +5,7 @@
  * usb_lowlevel.c
  * - Low Level IO
  */
-#define DEBUG  1
+#define DEBUG  0
 #include <acess.h>
 #include "usb.h"
 #include "usb_proto.h"
@@ -95,7 +95,6 @@ int USB_int_ReadDescriptor(tUSBDevice *Dev, int Endpoint, int Type, int Index, i
        const int       ciMaxPacketSize = 0x400;
        struct sDeviceRequest   req;
         int    bToggle = 0;
-       void    *final;
         int    dest = Dev->Address*16 + Endpoint;
 
        ENTER("pDev xdest iType iIndex iLength pDest",
@@ -131,7 +130,7 @@ int USB_int_ReadDescriptor(tUSBDevice *Dev, int Endpoint, int Type, int Index, i
 
        Threads_ClearEvent(THREAD_EVENT_SHORTWAIT);
        LOG("OUT (Status)");
-       final = Dev->Host->HostDef->ControlOUT(
+       Dev->Host->HostDef->ControlOUT(
                Dev->Host->Ptr, dest, 1,
                USB_int_WakeThread, Proc_GetCurThread(),
                NULL, 0
@@ -152,7 +151,9 @@ char *USB_int_GetDeviceString(tUSBDevice *Dev, int Endpoint, int Index)
 
        if(Index == 0)  return strdup("");
        
+       str.Length = 0;
        USB_int_ReadDescriptor(Dev, Endpoint, 3, Index, sizeof(str), &str);
+       if(str.Length == 0)     return NULL;
        if(str.Length < 2) {
                Log_Error("USB", "String %p:%i:%i:%i descriptor is undersized (%i)",
                        Dev->Host, Dev->Address, Endpoint, Index, str.Length);

UCC git Repository :: git.ucc.asn.au