[PATCH] drivers/char/lcd.c: misc_register() can fail
authorChristophe Lucas <clucas@rotomalug.org>
Sat, 10 Sep 2005 07:26:32 +0000 (00:26 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 10 Sep 2005 17:06:25 +0000 (10:06 -0700)
Signed-off-by: Christophe Lucas <clucas@rotomalug.org>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/lcd.c

index cf01a720eb2eff74a8154510cfd970ebbfb60f8d..b771611461445548bed26bd09df0c06fe2265587 100644 (file)
@@ -613,10 +613,15 @@ static struct miscdevice lcd_dev = {
 
 static int lcd_init(void)
 {
+       int ret;
        unsigned long data;
 
        pr_info("%s\n", LCD_DRIVER);
-       misc_register(&lcd_dev);
+       ret = misc_register(&lcd_dev);
+       if (ret) {
+               printk(KERN_WARNING LCD "Unable to register misc device.\n");
+               return ret;
+       }
 
        /* Check region? Naaah! Just snarf it up. */
 /*     request_region(RTC_PORT(0), RTC_IO_EXTENT, "lcd");*/