summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm-debug.c
diff options
context:
space:
mode:
authorJean Pihet <jean.pihet@newoldbits.com>2012-02-01 09:37:31 +0100
committerKevin Hilman <khilman@ti.com>2012-03-06 00:38:02 +0100
commit401606fd708885d28ce3c14a2a8fe612f8a6b50f (patch)
treec29ad66364c171fc02648914e550484a5dd67efb /arch/arm/mach-omap2/pm-debug.c
parentARM: OMAP2+: PM: share clkdms_setup() across OMAP2, 3, 4 (diff)
downloadlinux-401606fd708885d28ce3c14a2a8fe612f8a6b50f.tar.xz
linux-401606fd708885d28ce3c14a2a8fe612f8a6b50f.zip
ARM: OMAP2+: PM debug: fix the use of debugfs_create_* API
Check the return code pointer value from debugfs_create_dir for error or NULL. Also added an additional check to prevent the creation of a 'suspend' entry at the debugfs root in case a power domain directory cannot be created. Signed-off-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm-debug.c')
-rw-r--r--arch/arm/mach-omap2/pm-debug.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 4411163e012d..814bcd901596 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -220,8 +220,8 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
return 0;
d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir);
-
- (void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d,
+ if (!(IS_ERR_OR_NULL(d)))
+ (void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d,
(void *)pwrdm, &pwrdm_suspend_fops);
return 0;
@@ -264,7 +264,7 @@ static int __init pm_dbg_init(void)
return 0;
d = debugfs_create_dir("pm_debug", NULL);
- if (IS_ERR(d))
+ if (IS_ERR_OR_NULL(d))
return PTR_ERR(d);
(void) debugfs_create_file("count", S_IRUGO,