In my understanding we never call .disconnect() when .probe()
returns error. Change .probe() to return error all cases it cannot
handle given interface and simplify .disconnect() handling.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
if (d->intf->cur_altsetting->desc.bInterfaceNumber !=
d->props.bInterfaceNumber) {
- ret = 0;
+ ret = -ENODEV;
goto err_kfree;
}
void dvb_usbv2_disconnect(struct usb_interface *intf)
{
struct dvb_usb_device *d = usb_get_intfdata(intf);
- const char *name = "generic DVB-USB module";
+ const char *name;
pr_debug("%s: pid=%d work_pid=%d\n", __func__, current->pid,
d->work_pid);
if (d->work_pid != current->pid)
cancel_work_sync(&d->probe_work);
- if (d) {
- name = d->name;
- dvb_usbv2_exit(d);
- }
+ name = d->name;
+ dvb_usbv2_exit(d);
pr_info("%s: '%s' successfully deinitialized and disconnected\n",
KBUILD_MODNAME, name);