Minimize differences between UHCI and OHCI
authorHervé Poussineau <hpoussin@reactos.org>
Mon, 12 Dec 2005 22:52:16 +0000 (22:52 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Mon, 12 Dec 2005 22:52:16 +0000 (22:52 +0000)
No need to return an empty string in IRP_MN_QUERY_ID / BusQueryInstanceID ; a null string is enough

svn path=/trunk/; revision=20130

reactos/drivers/usb/miniport/common/pdo.c
reactos/drivers/usb/miniport/usbohci/ohci.c
reactos/drivers/usb/miniport/usbuhci/uhci.c

index 4e39430..abdda03 100644 (file)
@@ -170,8 +170,8 @@ UsbMpPdoQueryId(
                case BusQueryInstanceID:
                {
                        DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
                case BusQueryInstanceID:
                {
                        DPRINT("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
-                       RtlInitUnicodeString(&SourceString, L"");
-                       break;
+                       *Information = 0;
+                       return Status;
                }
                default:
                        DPRINT1("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
                }
                default:
                        DPRINT1("USBMP: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
index 2da6b0d..a97c465 100644 (file)
@@ -21,16 +21,16 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
        /* Initialize generic linux structure */\r
        dev->irq = DeviceExtension->InterruptVector;\r
        dev->dev_ext = (PVOID)DeviceExtension;\r
        /* Initialize generic linux structure */\r
        dev->irq = DeviceExtension->InterruptVector;\r
        dev->dev_ext = (PVOID)DeviceExtension;\r
-       dev->dev.dev_ext = (PVOID)DeviceObject;\r
+       dev->dev.dev_ext = DeviceObject;\r
        dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_OHCI_TAG); // 128 max len for slot name\r
 \r
        dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_OHCI_TAG); // 128 max len for slot name\r
 \r
-       // Init wrapper\r
+       /* Init wrapper */\r
        init_wrapper(dev);\r
 \r
        strcpy(dev->dev.name, "OpenHCI PCI-USB Controller");\r
        strcpy(dev->slot_name, "OHCD PCI Slot");\r
 \r
        init_wrapper(dev);\r
 \r
        strcpy(dev->dev.name, "OpenHCI PCI-USB Controller");\r
        strcpy(dev->slot_name, "OHCD PCI Slot");\r
 \r
-       // Init the OHCI HCD. Probe will be called automatically, but will fail because id=NULL\r
+       /* Init the OHCI HCD. Probe will be called automatically, but will fail because id=NULL */\r
        Status = ohci_hcd_pci_init();\r
        if (!NT_SUCCESS(Status))\r
        {\r
        Status = ohci_hcd_pci_init();\r
        if (!NT_SUCCESS(Status))\r
        {\r
@@ -40,10 +40,10 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
                return Status;\r
        }\r
 \r
                return Status;\r
        }\r
 \r
-       // Init core usb\r
+       /* Init core usb */\r
        usb_init();\r
 \r
        usb_init();\r
 \r
-       // Probe device with real id now\r
+       /* Probe device with real id now */\r
        ohci_pci_driver.probe(dev, ohci_pci_ids);\r
 \r
        return STATUS_SUCCESS;\r
        ohci_pci_driver.probe(dev, ohci_pci_ids);\r
 \r
        return STATUS_SUCCESS;\r
index bf07f78..2717103 100644 (file)
@@ -14,8 +14,7 @@ struct pci_device_id* pci_ids = &uhci_pci_ids[0];
 NTSTATUS
 InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
 {
 NTSTATUS
 InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
 {
-       NTSTATUS Status = STATUS_SUCCESS;
-
+       NTSTATUS Status;
        PUSBMP_DEVICE_EXTENSION DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        
        /* Create generic linux structure */
        PUSBMP_DEVICE_EXTENSION DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        
        /* Create generic linux structure */
@@ -26,8 +25,10 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
        /* Initialize generic linux structure */
        dev->irq = DeviceExtension->InterruptVector;
        dev->dev_ext = (PVOID)DeviceExtension;
        /* Initialize generic linux structure */
        dev->irq = DeviceExtension->InterruptVector;
        dev->dev_ext = (PVOID)DeviceExtension;
-       dev->dev.dev_ext = (PVOID)DeviceObject;
+       dev->dev.dev_ext = DeviceObject;
        dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_UHCI_TAG); // 128 max len for slot name
        dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_UHCI_TAG); // 128 max len for slot name
+
+       /* Init wrapper */
        init_wrapper(dev);
        
        strcpy(dev->dev.name, "UnivHCI PCI-USB Controller");
        init_wrapper(dev);
        
        strcpy(dev->dev.name, "UnivHCI PCI-USB Controller");
@@ -49,7 +50,7 @@ InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
        /* Probe device with real id now */
        uhci_pci_driver.probe(dev, uhci_pci_ids);
 
        /* Probe device with real id now */
        uhci_pci_driver.probe(dev, uhci_pci_ids);
 
-       return Status
+       return STATUS_SUCCESS
 }
 
 VOID STDCALL 
 }
 
 VOID STDCALL