Skip to content

Commit e24775e

Browse files
andy-shevDan Williams
authored andcommitted
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dan Williams <djbw@fb.com>
1 parent a6c268d commit e24775e

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

‎drivers/dma/dmatest.c‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,6 @@ static const struct file_operations dtf_results_fops = {
11311131
static int dmatest_register_dbgfs(struct dmatest_info *info)
11321132
{
11331133
struct dentry *d;
1134-
int ret = -ENOMEM;
11351134

11361135
d = debugfs_create_dir("dmatest", NULL);
11371136
if (IS_ERR(d))
@@ -1142,24 +1141,18 @@ static int dmatest_register_dbgfs(struct dmatest_info *info)
11421141
info->root = d;
11431142

11441143
/* Run or stop threaded test */
1145-
d = debugfs_create_file("run", S_IWUSR | S_IRUGO, info->root,
1146-
info, &dtf_run_fops);
1147-
if (IS_ERR_OR_NULL(d))
1148-
goto err_node;
1144+
debugfs_create_file("run", S_IWUSR | S_IRUGO, info->root, info,
1145+
&dtf_run_fops);
11491146

11501147
/* Results of test in progress */
1151-
d = debugfs_create_file("results", S_IRUGO, info->root, info,
1152-
&dtf_results_fops);
1153-
if (IS_ERR_OR_NULL(d))
1154-
goto err_node;
1148+
debugfs_create_file("results", S_IRUGO, info->root, info,
1149+
&dtf_results_fops);
11551150

11561151
return 0;
11571152

1158-
err_node:
1159-
debugfs_remove_recursive(info->root);
11601153
err_root:
11611154
pr_err("dmatest: Failed to initialize debugfs\n");
1162-
return ret;
1155+
return -ENOMEM;
11631156
}
11641157

11651158
static int __init dmatest_init(void)

0 commit comments

Comments
 (0)