Commit d808aa69 authored by Russell King's avatar Russell King

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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 23cbd4e8
...@@ -219,7 +219,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir) ...@@ -219,7 +219,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
return 0; return 0;
d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir); d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir);
if (!(IS_ERR_OR_NULL(d))) if (d)
(void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d, (void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d,
(void *)pwrdm, &pwrdm_suspend_fops); (void *)pwrdm, &pwrdm_suspend_fops);
...@@ -263,8 +263,8 @@ static int __init pm_dbg_init(void) ...@@ -263,8 +263,8 @@ static int __init pm_dbg_init(void)
return 0; return 0;
d = debugfs_create_dir("pm_debug", NULL); d = debugfs_create_dir("pm_debug", NULL);
if (IS_ERR_OR_NULL(d)) if (!d)
return PTR_ERR(d); return -EINVAL;
(void) debugfs_create_file("count", S_IRUGO, (void) debugfs_create_file("count", S_IRUGO,
d, (void *)DEBUG_FILE_COUNTERS, &debug_fops); d, (void *)DEBUG_FILE_COUNTERS, &debug_fops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment