[PATCH] ARM: OMAP3+: PM debug: fix the use of debugfs_create_* API

Jean Pihet jean.pihet at newoldbits.com
Tue Jan 31 06:20:19 EST 2012


The debugfs_create_* API returns a NULL ptr in case of problem.
Fix the PM debug code to take this into account.

Signed-off-by: Jean Pihet <j-pihet at ti.com>
---
 arch/arm/mach-omap2/pm-debug.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 4411163..e5bf367 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -264,8 +264,8 @@ static int __init pm_dbg_init(void)
 		return 0;
 
 	d = debugfs_create_dir("pm_debug", NULL);
-	if (IS_ERR(d))
-		return PTR_ERR(d);
+	if (!d)
+		return -ENOMEM;
 
 	(void) debugfs_create_file("count", S_IRUGO,
 		d, (void *)DEBUG_FILE_COUNTERS, &debug_fops);
-- 
1.7.5.4




More information about the linux-arm-kernel mailing list