From: Randy Dunlap Date: Tue, 17 May 2005 04:53:56 +0000 (-0700) Subject: [PATCH] pcmcia/ds: handle any error code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=afbf510d47c4009f5d67ec3c0e0b45eb0441bca3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] pcmcia/ds: handle any error code register_chrdev() can return errors (negative) other then -EBUSY, so check for any negative error code. Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 66150d08b5c7..c4ade288c5da 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -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;