]> err.no Git - linux-2.6/commitdiff
[PATCH] pcmcia/ds: handle any error code
authorRandy Dunlap <rdunlap@xenotime.net>
Tue, 17 May 2005 04:53:56 +0000 (21:53 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 17 May 2005 14:59:21 +0000 (07:59 -0700)
register_chrdev() can return errors (negative) other then -EBUSY, so check
for any negative error code.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/pcmcia/ds.c

index 66150d08b5c7c6d470c83a723559504b9b40dc70..c4ade288c5da6dcdcb497882f1dd1f8b659c29f4 100644 (file)
@@ -1592,9 +1592,9 @@ static int __init init_pcmcia_bus(void)
 
        /* Set up character device for user mode clients */
        i = register_chrdev(0, "pcmcia", &ds_fops);
-       if (i == -EBUSY)
+       if (i < 0)
                printk(KERN_NOTICE "unable to find a free device # for "
-                      "Driver Services\n");
+                      "Driver Services (error=%d)\n", i);
        else
                major_dev = i;