This is a patch against the stock 2.4.17 usb-uhci.c file. It causes some
allocated memory regions to be cleaned up, pci cleanup stuff, etc. In
essence, if your usb-ohci driver fails somewhere in the probe, it cleans
itself up enough so that you can do some more testing to the driver
without having to reboot your system because the memory regions of your
card are still claimed.
I had to figure out some way to tell whether the bus had registered with
the usb subsystem, so I checked for a non zero value in the bus structure,
as shown. If this is not a valid way to do so (I didn't want to do any
major architectural changes to the driver), suggestions are
appreciated. Otherwise, if it looks good, Greg could you apply this
patch? Thanks.
eldorado:/usr/src/linux-2.4# diff
../linux-2.4.17stock/drivers/usb/usb-ohci.c drivers/usb/usb-ohci.c
49a50
>
64c65
< #undef DEBUG
---
> #define DEBUG
2384a2386,2387
> pci_set_drvdata(dev, NULL);
> pci_free_consistent(ohci->ohci_dev, sizeof *ohci->hcca, ohci->hcca,
>ohci->hcca_dma);
2416,2417c2419,2423
< usb_deregister_bus (ohci->bus);
< usb_free_bus (ohci->bus);
---
> if (ohci->bus) {
> if (ohci->bus->busnum)
> usb_deregister_bus (ohci->bus);
> usb_free_bus (ohci->bus);
> }
2562a2569
> int res = 0;
2570a2578
> pci_disable_device(dev);
2578a2587
> pci_disable_device(dev);
2584a2594,2595
> release_mem_region(mem_resource, mem_len);
> pci_disable_device(dev);
2591c2602,2611
< return hc_found_ohci (dev, dev->irq, mem_base, id);
---
> res = hc_found_ohci (dev, dev->irq, mem_base, id);
> if (res < 0) {
> iounmap(mem_base);
> release_mem_region(mem_resource, mem_len);
> pci_disable_device(dev);
> }
>
> return res;
>
>
2892a2913
>
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel