Commit c9e5993d authored by Henning Meier-Geinitz's avatar Henning Meier-Geinitz Committed by Greg Kroah-Hartman

[PATCH] USB scanner driver: report back return codes

Report back return codes of usb_register and usb_usbmit_urb instead of
-1 or -ENONMEM (Daniele Bellucci).
parent 5cc25f27
...@@ -372,6 +372,8 @@ ...@@ -372,6 +372,8 @@
* 0.4.15 2003-09-12 * 0.4.15 2003-09-12
* - Use static declarations for usb_scanner_init/usb_scanner_exit * - Use static declarations for usb_scanner_init/usb_scanner_exit
* (Daniele Bellucci). * (Daniele Bellucci).
* - Report back return codes of usb_register and usb_usbmit_urb instead of -1 or
* -ENONMEM (Daniele Bellucci).
* *
* *
* TODO * TODO
...@@ -1066,11 +1068,12 @@ probe_scanner(struct usb_interface *intf, ...@@ -1066,11 +1068,12 @@ probe_scanner(struct usb_interface *intf,
// endpoint[(int)have_intr].bInterval); // endpoint[(int)have_intr].bInterval);
250); 250);
if (usb_submit_urb(scn->scn_irq, GFP_KERNEL)) { retval = usb_submit_urb(scn->scn_irq, GFP_KERNEL);
if (retval) {
err("probe_scanner(%d): Unable to allocate INT URB.", intf->minor); err("probe_scanner(%d): Unable to allocate INT URB.", intf->minor);
kfree(scn); kfree(scn);
up(&scn_mutex); up(&scn_mutex);
return -ENOMEM; return retval;
} }
} }
...@@ -1183,13 +1186,16 @@ usb_scanner_exit(void) ...@@ -1183,13 +1186,16 @@ usb_scanner_exit(void)
static int __init static int __init
usb_scanner_init (void) usb_scanner_init (void)
{ {
if (usb_register(&scanner_driver) < 0) int retval;
return -1; retval = usb_register(&scanner_driver);
if (retval)
goto out;
info(DRIVER_VERSION ":" DRIVER_DESC); info(DRIVER_VERSION ":" DRIVER_DESC);
if (vendor != -1 && product != -1) if (vendor != -1 && product != -1)
info("probe_scanner: User specified USB scanner -- Vendor:Product - %x:%x", vendor, product); info("probe_scanner: User specified USB scanner -- Vendor:Product - %x:%x", vendor, product);
return 0; out:
return retval;
} }
module_init(usb_scanner_init); module_init(usb_scanner_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment