Commit 3a7a8824 authored by Coywolf Qi Hunt's avatar Coywolf Qi Hunt Committed by Thomas Gleixner

[MTD] mtdchar: Return the real error code when create_class() failed

Signed-off-by: default avatarCoywolf Qi Hunt <coywolf@sosdg.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 9bc7b387
/* /*
* $Id: mtdchar.c,v 1.72 2005/06/30 00:23:24 tpoynor Exp $ * $Id: mtdchar.c,v 1.73 2005/07/04 17:36:41 gleixner Exp $
* *
* Character-device access to raw MTD devices. * Character-device access to raw MTD devices.
* *
...@@ -649,7 +649,7 @@ static int __init init_mtdchar(void) ...@@ -649,7 +649,7 @@ static int __init init_mtdchar(void)
if (IS_ERR(mtd_class)) { if (IS_ERR(mtd_class)) {
printk(KERN_ERR "Error creating mtd class.\n"); printk(KERN_ERR "Error creating mtd class.\n");
unregister_chrdev(MTD_CHAR_MAJOR, "mtd"); unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
return 1; return PTR_ERR(mtd_class);
} }
register_mtd_user(&notifier); register_mtd_user(&notifier);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment