KBUILD_MODNAME, d->name);
ret = dvb_usbv2_download_firmware(d);
if (ret == 0) {
+ /* device is warm, continue initialization */
;
} else if (ret == RECONNECTS_USB) {
- ret = 0;
- goto exit_usb_driver_release_interface;
+ /*
+ * USB core will call disconnect() and then probe()
+ * as device reconnects itself from the USB bus.
+ * disconnect() will release all driver resources
+ * and probe() is called for 'new' device. As 'new'
+ * device is warm we should never go here again.
+ */
+ return;
} else {
+ /* Unexpected fatal error. We must unregister driver
+ * manually from the device, because device is already
+ * register by returning from probe() with success.
+ * usb_driver_release_interface() finally calls
+ * disconnect() in order to free resources.
+ */
goto err_usb_driver_release_interface;
}
}
err_usb_driver_release_interface:
pr_info("%s: '%s' error while loading driver (%d)\n", KBUILD_MODNAME,
d->name, ret);
-exit_usb_driver_release_interface:
- /* it finally calls .disconnect() which frees mem */
+ /* it finally calls disconnect() which frees mem */
usb_driver_release_interface(to_usb_driver(d->intf->dev.driver),
d->intf);
pr_debug("%s: failed=%d\n", __func__, ret);