From: Dominik Brodowski Date: Mon, 27 Jun 2005 23:29:00 +0000 (-0700) Subject: [PATCH] pcmcia: properly handle all errors of register_chrdev X-Git-Tag: v2.6.13-rc1~46^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1a8ceafce5f1e68c28c7ba52fd7e72ab0008eb46;p=linux-2.6-omap-h63xx.git [PATCH] pcmcia: properly handle all errors of register_chrdev register_chrdev() can return errors (negative) other then -EBUSY, so check for any negative error code. Signed-off-by: Randy Dunlap Signed-off-by: Dominik Brodowski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c index 3084d8a3ba4..b883bc151ed 100644 --- a/drivers/pcmcia/pcmcia_ioctl.c +++ b/drivers/pcmcia/pcmcia_ioctl.c @@ -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;