[EMAIL PROTECTED], 2003-08-11 21:39:31+02:00, [EMAIL PROTECTED] - API change to check errors in usb_driver_claim_interface and fix a race condition between releasing and reclaiming an interface
Glad to see that API signature finally get fixed ...
- // FIXME change API to report an error in this case
- if (iface->driver)
- err ("%s driver booted %s off interface %p",
- driver->name, iface->driver->name, iface);
- else
+ lock_kernel();
+ if (iface->driver) {
+ unlock_kernel();
+ err ("%s driver booted %s off interface %p",
+ driver->name, iface->driver->name, iface);
Erm, but it's NOT being booted off, because of this change. There's no longer even an error ... so that's wrong on two counts. Best to just delete the err() diagnostic completely.
+ return -EBUSY;
+ } else {
dbg("%s driver claimed interface %p", driver->name, iface);
This one would be improved by using dev_dbg() ... likely needs to be moved after the claim is made, so the driver model debug calls can work without oopsing (traversing null pointers). It also doesn't need to live in an "else" ... :)
+ }
iface->driver = driver;
This routine should be using device_bind_driver(). There's no longer any need to duplicate "which driver" state between the driver model and usbcore ... iface->driver should go away, in favor of iface->dev.driver.
usb_set_intfdata(iface, priv);
+ unlock_kernel();
+ return 0;
}
/**
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
