forked from Minki/linux
media: cec: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
31163906f1
commit
5d0d7b9009
@ -359,27 +359,16 @@ int cec_register_adapter(struct cec_adapter *adap,
|
||||
if (!top_cec_dir)
|
||||
return 0;
|
||||
|
||||
adap->cec_dir = debugfs_create_dir(dev_name(&adap->devnode.dev), top_cec_dir);
|
||||
if (IS_ERR_OR_NULL(adap->cec_dir)) {
|
||||
pr_warn("cec-%s: Failed to create debugfs dir\n", adap->name);
|
||||
return 0;
|
||||
}
|
||||
adap->status_file = debugfs_create_devm_seqfile(&adap->devnode.dev,
|
||||
"status", adap->cec_dir, cec_adap_status);
|
||||
if (IS_ERR_OR_NULL(adap->status_file)) {
|
||||
pr_warn("cec-%s: Failed to create status file\n", adap->name);
|
||||
debugfs_remove_recursive(adap->cec_dir);
|
||||
adap->cec_dir = NULL;
|
||||
return 0;
|
||||
}
|
||||
adap->cec_dir = debugfs_create_dir(dev_name(&adap->devnode.dev),
|
||||
top_cec_dir);
|
||||
|
||||
debugfs_create_devm_seqfile(&adap->devnode.dev, "status", adap->cec_dir,
|
||||
cec_adap_status);
|
||||
|
||||
if (!adap->ops->error_inj_show || !adap->ops->error_inj_parse_line)
|
||||
return 0;
|
||||
adap->error_inj_file = debugfs_create_file("error-inj", 0644,
|
||||
adap->cec_dir, adap,
|
||||
&cec_error_inj_fops);
|
||||
if (IS_ERR_OR_NULL(adap->error_inj_file))
|
||||
pr_warn("cec-%s: Failed to create error-inj file\n",
|
||||
adap->name);
|
||||
debugfs_create_file("error-inj", 0644, adap->cec_dir, adap,
|
||||
&cec_error_inj_fops);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -248,8 +248,6 @@ struct cec_adapter {
|
||||
#endif
|
||||
|
||||
struct dentry *cec_dir;
|
||||
struct dentry *status_file;
|
||||
struct dentry *error_inj_file;
|
||||
|
||||
u32 sequence;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user