Browse Source

MIPS: Fix debugfs_create_*'s error checking method for mips/kernel/

debugfs_create_*() returns NULL on error.  Make its callers return -ENODEV
on error.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Zhaolei 16 years ago
parent
commit
b517531ce5
2 changed files with 6 additions and 6 deletions
  1. 2 2
      arch/mips/kernel/setup.c
  2. 4 4
      arch/mips/kernel/unaligned.c

+ 2 - 2
arch/mips/kernel/setup.c

@@ -601,8 +601,8 @@ static int __init debugfs_mips(void)
 	struct dentry *d;
 	struct dentry *d;
 
 
 	d = debugfs_create_dir("mips", NULL);
 	d = debugfs_create_dir("mips", NULL);
-	if (IS_ERR(d))
-		return PTR_ERR(d);
+	if (!d)
+		return -ENOMEM;
 	mips_debugfs_dir = d;
 	mips_debugfs_dir = d;
 	return 0;
 	return 0;
 }
 }

+ 4 - 4
arch/mips/kernel/unaligned.c

@@ -560,12 +560,12 @@ static int __init debugfs_unaligned(void)
 		return -ENODEV;
 		return -ENODEV;
 	d = debugfs_create_u32("unaligned_instructions", S_IRUGO,
 	d = debugfs_create_u32("unaligned_instructions", S_IRUGO,
 			       mips_debugfs_dir, &unaligned_instructions);
 			       mips_debugfs_dir, &unaligned_instructions);
-	if (IS_ERR(d))
-		return PTR_ERR(d);
+	if (!d)
+		return -ENOMEM;
 	d = debugfs_create_u32("unaligned_action", S_IRUGO | S_IWUSR,
 	d = debugfs_create_u32("unaligned_action", S_IRUGO | S_IWUSR,
 			       mips_debugfs_dir, &unaligned_action);
 			       mips_debugfs_dir, &unaligned_action);
-	if (IS_ERR(d))
-		return PTR_ERR(d);
+	if (!d)
+		return -ENOMEM;
 	return 0;
 	return 0;
 }
 }
 __initcall(debugfs_unaligned);
 __initcall(debugfs_unaligned);