From cf85d5ca880c9611906e0ca0c729fdf01c724501 Mon Sep 17 00:00:00 2001 From: Christophe Lucas Date: Sat, 10 Sep 2005 00:26:32 -0700 Subject: [PATCH] [PATCH] drivers/char/lcd.c: misc_register() can fail Signed-off-by: Christophe Lucas Signed-off-by: Domen Puncer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/lcd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c index cf01a720eb2e..b77161146144 100644 --- a/drivers/char/lcd.c +++ b/drivers/char/lcd.c @@ -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");*/ -- 2.30.2