[PATCH] pcmcia: properly handle all errors of register_chrdev
authorDominik Brodowski <linux@dominikbrodowski.net>
Mon, 27 Jun 2005 23:29:00 +0000 (16:29 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 28 Jun 2005 01:03:22 +0000 (18:03 -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: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/pcmcia/pcmcia_ioctl.c

index 3084d8a3ba411040321a9e085e374476eba512d9..b883bc151ed00f58b9be03c994974b7e2aaca0cb 100644 (file)
@@ -760,9 +760,9 @@ void __init pcmcia_setup_ioctl(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;