aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-02-24 05:52:18 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-02-24 05:52:18 -0500
commitd808aa69a7e85dea850ffe7b3d076be696da35be (patch)
tree312cd0c2676c14a97f67f020cce0ddf5fbd1d84d
parent23cbd4e84f98b36c91d19990760207112f142c5b (diff)
ARM: cleanup: debugfs error handling
Debugfs functions return NULL when they fail, or an error pointer when not configured. The intention behind the error pointer is that it appears as a valid pointer to the caller, and so the caller continues inspite of debugfs not being available. Debugfs failure should only ever be checked with (!ptr) and not the IS_ERR*() functions. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-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 e2c291f52f92..548547e14796 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -219,7 +219,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
219 return 0; 219 return 0;
220 220
221 d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir); 221 d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir);
222 if (!(IS_ERR_OR_NULL(d))) 222 if (d)
223 (void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d, 223 (void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d,
224 (void *)pwrdm, &pwrdm_suspend_fops); 224 (void *)pwrdm, &pwrdm_suspend_fops);
225 225
@@ -263,8 +263,8 @@ static int __init pm_dbg_init(void)
263 return 0; 263 return 0;
264 264
265 d = debugfs_create_dir("pm_debug", NULL); 265 d = debugfs_create_dir("pm_debug", NULL);
266 if (IS_ERR_OR_NULL(d)) 266 if (!d)
267 return PTR_ERR(d); 267 return -EINVAL;
268 268
269 (void) debugfs_create_file("count", S_IRUGO, 269 (void) debugfs_create_file("count", S_IRUGO,
270 d, (void *)DEBUG_FILE_COUNTERS, &debug_fops); 270 d, (void *)DEBUG_FILE_COUNTERS, &debug_fops);