From 823eebac89f7adef3fb75e2a68e9e88be9b4afbe Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Sat, 9 Jun 2012 23:42:47 -0300 Subject: [PATCH] [media] dvb_usb_v2: probe/disconnect error handling 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/dvb_usb_init.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_init.c b/drivers/media/dvb/dvb-usb/dvb_usb_init.c index 2d0fbaf6c6d0..1f0fb11c587c 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_init.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_init.c @@ -393,7 +393,7 @@ int dvb_usbv2_probe(struct usb_interface *intf, if (d->intf->cur_altsetting->desc.bInterfaceNumber != d->props.bInterfaceNumber) { - ret = 0; + ret = -ENODEV; goto err_kfree; } @@ -419,7 +419,7 @@ EXPORT_SYMBOL(dvb_usbv2_probe); 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); @@ -428,10 +428,8 @@ void dvb_usbv2_disconnect(struct usb_interface *intf) 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); -- 2.30.2