Commit e24775e4 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Dan Williams

dmatest: remove IS_ERR_OR_NULL checks of debugfs calls

There is a really little chance when we are able to create a directory and are
not able to create nodes under it. So, this patch just removes those checks.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarDan Williams <djbw@fb.com>
parent a6c268d0
...@@ -1131,7 +1131,6 @@ static const struct file_operations dtf_results_fops = { ...@@ -1131,7 +1131,6 @@ static const struct file_operations dtf_results_fops = {
static int dmatest_register_dbgfs(struct dmatest_info *info) static int dmatest_register_dbgfs(struct dmatest_info *info)
{ {
struct dentry *d; struct dentry *d;
int ret = -ENOMEM;
d = debugfs_create_dir("dmatest", NULL); d = debugfs_create_dir("dmatest", NULL);
if (IS_ERR(d)) if (IS_ERR(d))
...@@ -1142,24 +1141,18 @@ static int dmatest_register_dbgfs(struct dmatest_info *info) ...@@ -1142,24 +1141,18 @@ static int dmatest_register_dbgfs(struct dmatest_info *info)
info->root = d; info->root = d;
/* Run or stop threaded test */ /* Run or stop threaded test */
d = debugfs_create_file("run", S_IWUSR | S_IRUGO, info->root, debugfs_create_file("run", S_IWUSR | S_IRUGO, info->root, info,
info, &dtf_run_fops); &dtf_run_fops);
if (IS_ERR_OR_NULL(d))
goto err_node;
/* Results of test in progress */ /* Results of test in progress */
d = debugfs_create_file("results", S_IRUGO, info->root, info, debugfs_create_file("results", S_IRUGO, info->root, info,
&dtf_results_fops); &dtf_results_fops);
if (IS_ERR_OR_NULL(d))
goto err_node;
return 0; return 0;
err_node:
debugfs_remove_recursive(info->root);
err_root: err_root:
pr_err("dmatest: Failed to initialize debugfs\n"); pr_err("dmatest: Failed to initialize debugfs\n");
return ret; return -ENOMEM;
} }
static int __init dmatest_init(void) static int __init dmatest_init(void)
......
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