Commit 68d9787b authored by Manivannan Sadhasivam's avatar Manivannan Sadhasivam Committed by Mathieu Poirier

remoteproc: Don't bother checking the return value of debugfs_create*

DebugFS APIs are designed to return only the error pointers and not NULL
in the case of failure. So these return pointers are safe to be passed on
to the successive debugfs_create* APIs.

Therefore, let's just get rid of the checks.
Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20220329154616.58902-1-manivannan.sadhasivam@linaro.orgSigned-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
parent f20e232d
...@@ -684,10 +684,6 @@ static int rproc_handle_trace(struct rproc *rproc, void *ptr, ...@@ -684,10 +684,6 @@ static int rproc_handle_trace(struct rproc *rproc, void *ptr,
/* create the debugfs entry */ /* create the debugfs entry */
trace->tfile = rproc_create_trace_file(name, rproc, trace); trace->tfile = rproc_create_trace_file(name, rproc, trace);
if (!trace->tfile) {
kfree(trace);
return -EINVAL;
}
list_add_tail(&trace->node, &rproc->traces); list_add_tail(&trace->node, &rproc->traces);
......
...@@ -386,16 +386,8 @@ void rproc_remove_trace_file(struct dentry *tfile) ...@@ -386,16 +386,8 @@ void rproc_remove_trace_file(struct dentry *tfile)
struct dentry *rproc_create_trace_file(const char *name, struct rproc *rproc, struct dentry *rproc_create_trace_file(const char *name, struct rproc *rproc,
struct rproc_debug_trace *trace) struct rproc_debug_trace *trace)
{ {
struct dentry *tfile; return debugfs_create_file(name, 0400, rproc->dbg_dir, trace,
tfile = debugfs_create_file(name, 0400, rproc->dbg_dir, trace,
&trace_rproc_ops); &trace_rproc_ops);
if (!tfile) {
dev_err(&rproc->dev, "failed to create debugfs trace entry\n");
return NULL;
}
return tfile;
} }
void rproc_delete_debug_dir(struct rproc *rproc) void rproc_delete_debug_dir(struct rproc *rproc)
...@@ -411,8 +403,6 @@ void rproc_create_debug_dir(struct rproc *rproc) ...@@ -411,8 +403,6 @@ void rproc_create_debug_dir(struct rproc *rproc)
return; return;
rproc->dbg_dir = debugfs_create_dir(dev_name(dev), rproc_dbg); rproc->dbg_dir = debugfs_create_dir(dev_name(dev), rproc_dbg);
if (!rproc->dbg_dir)
return;
debugfs_create_file("name", 0400, rproc->dbg_dir, debugfs_create_file("name", 0400, rproc->dbg_dir,
rproc, &rproc_name_ops); rproc, &rproc_name_ops);
...@@ -430,11 +420,8 @@ void rproc_create_debug_dir(struct rproc *rproc) ...@@ -430,11 +420,8 @@ void rproc_create_debug_dir(struct rproc *rproc)
void __init rproc_init_debugfs(void) void __init rproc_init_debugfs(void)
{ {
if (debugfs_initialized()) { if (debugfs_initialized())
rproc_dbg = debugfs_create_dir(KBUILD_MODNAME, NULL); rproc_dbg = debugfs_create_dir(KBUILD_MODNAME, NULL);
if (!rproc_dbg)
pr_err("can't create debugfs dir\n");
}
} }
void __exit rproc_exit_debugfs(void) void __exit rproc_exit_debugfs(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