Skip to content

Commit

Permalink
[MTD] mtdchar: Return the real error code when create_class() failed
Browse files Browse the repository at this point in the history
Signed-off-by: Coywolf Qi Hunt <coywolf@sosdg.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Coywolf Qi Hunt authored and Thomas Gleixner committed Jul 4, 2005
1 parent 9bc7b38 commit 3a7a882
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $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.
*
Expand Down Expand Up @@ -649,7 +649,7 @@ static int __init init_mtdchar(void)
if (IS_ERR(mtd_class)) {
printk(KERN_ERR "Error creating mtd class.\n");
unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
return 1;
return PTR_ERR(mtd_class);
}

register_mtd_user(&notifier);
Expand Down

0 comments on commit 3a7a882

Please sign in to comment.