From: Dominik Brodowski 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 --- drivers/pcmcia/pcmcia_ioctl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/pcmcia/pcmcia_ioctl.c~pcmcia-properly-handle-all-errors-of-register_chrdev drivers/pcmcia/pcmcia_ioctl.c --- 25/drivers/pcmcia/pcmcia_ioctl.c~pcmcia-properly-handle-all-errors-of-register_chrdev Fri May 20 16:52:53 2005 +++ 25-akpm/drivers/pcmcia/pcmcia_ioctl.c Fri May 20 16:52:53 2005 @@ -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; _