diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2002-05-02 01:26:48 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2002-05-02 01:26:48 -0700 |
| commit | 2babc05bb821e6c729e300b2e906c8a31a289df9 (patch) | |
| tree | 78859c7e5922a9c5e85549dc38ad43782db8a379 /drivers/usb/class | |
| parent | 526e60f87b49fa72c54f4ba658262b81cfb412db (diff) | |
USB
cleaned up checking the return value of usb_register_dev()
Diffstat (limited to 'drivers/usb/class')
| -rw-r--r-- | drivers/usb/class/printer.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/class/printer.c b/drivers/usb/class/printer.c index 150574d36a3e..73a1b11a639a 100644 --- a/drivers/usb/class/printer.c +++ b/drivers/usb/class/printer.c @@ -794,6 +794,7 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum, { struct usblp *usblp = 0; int protocol; + int retval; char name[6]; /* Malloc and start initializing usblp structure so we can use it @@ -808,7 +809,12 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum, init_waitqueue_head(&usblp->wait); usblp->ifnum = ifnum; - if (usb_register_dev(&usblp_driver, 1, &usblp->minor)) { + retval = usb_register_dev(&usblp_driver, 1, &usblp->minor); + if (retval) { + if (retval != -ENODEV) { + err("Not able to get a minor for this device."); + goto abort; + } /* Look for a free usblp_table entry on our own. */ while (usblp_table[usblp->minor]) { usblp->minor++; |
