Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] drivers/char/lcd.c: misc_register() can fail

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>

authored by

Christophe Lucas and committed by
Linus Torvalds
cf85d5ca 819a3eba

+6 -1
+6 -1
drivers/char/lcd.c
··· 613 613 614 614 static int lcd_init(void) 615 615 { 616 + int ret; 616 617 unsigned long data; 617 618 618 619 pr_info("%s\n", LCD_DRIVER); 619 - misc_register(&lcd_dev); 620 + ret = misc_register(&lcd_dev); 621 + if (ret) { 622 + printk(KERN_WARNING LCD "Unable to register misc device.\n"); 623 + return ret; 624 + } 620 625 621 626 /* Check region? Naaah! Just snarf it up. */ 622 627 /* request_region(RTC_PORT(0), RTC_IO_EXTENT, "lcd");*/