On Wed, 2019-10-09 at 13:28 -0400, Alan Stern wrote:
> No, that's not quite it.
> Here's what should happen when the subclass driver is being probed:
> First, call the generic_probe routine, and return immediately if that
> fails.  Then call the subclass driver's probe routine.  If that gets
> an
> error, fail the probe call but tell the device core that the device
> is
> now bound to the generic driver, not to the subclass driver.

So, something like that, on top of the existing patches? (I'm not sure
whether device_driver_attach is the correct call to use here).

-       if (udriver->probe)
-               return udriver->probe(udev);
-       return 0;
+       if (!udriver->probe)
+               return 0;
+       error = udriver->probe(udev);
+       if (error == -ENODEV &&
+           udrv != &usb_generic_driver)
+               return device_driver_attach(usb_generic_driver.drvwrap.driver, 
+       return error;

Anything else in this patch series? I was concerned about the naming
for "generic_init" in patch 2 ("subclass").

If there's nothing, I'll test and respin the patchset with the above
changes tomorrow.


Reply via email to