Commit 1d8f95c4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Mauro Carvalho Chehab

media: radio: si476x: 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 8c23f411
...@@ -1344,60 +1344,24 @@ static const struct file_operations radio_rsq_primary_fops = { ...@@ -1344,60 +1344,24 @@ static const struct file_operations radio_rsq_primary_fops = {
}; };
static int si476x_radio_init_debugfs(struct si476x_radio *radio) static void si476x_radio_init_debugfs(struct si476x_radio *radio)
{ {
struct dentry *dentry; radio->debugfs = debugfs_create_dir(dev_name(radio->v4l2dev.dev), NULL);
int ret;
dentry = debugfs_create_dir(dev_name(radio->v4l2dev.dev), NULL); debugfs_create_file("acf", S_IRUGO, radio->debugfs, radio,
if (IS_ERR(dentry)) { &radio_acf_fops);
ret = PTR_ERR(dentry);
goto exit;
}
radio->debugfs = dentry;
dentry = debugfs_create_file("acf", S_IRUGO,
radio->debugfs, radio, &radio_acf_fops);
if (IS_ERR(dentry)) {
ret = PTR_ERR(dentry);
goto cleanup;
}
dentry = debugfs_create_file("rds_blckcnt", S_IRUGO, debugfs_create_file("rds_blckcnt", S_IRUGO, radio->debugfs, radio,
radio->debugfs, radio, &radio_rds_blckcnt_fops);
&radio_rds_blckcnt_fops);
if (IS_ERR(dentry)) {
ret = PTR_ERR(dentry);
goto cleanup;
}
dentry = debugfs_create_file("agc", S_IRUGO, debugfs_create_file("agc", S_IRUGO, radio->debugfs, radio,
radio->debugfs, radio, &radio_agc_fops); &radio_agc_fops);
if (IS_ERR(dentry)) {
ret = PTR_ERR(dentry);
goto cleanup;
}
dentry = debugfs_create_file("rsq", S_IRUGO, debugfs_create_file("rsq", S_IRUGO, radio->debugfs, radio,
radio->debugfs, radio, &radio_rsq_fops); &radio_rsq_fops);
if (IS_ERR(dentry)) {
ret = PTR_ERR(dentry);
goto cleanup;
}
dentry = debugfs_create_file("rsq_primary", S_IRUGO, debugfs_create_file("rsq_primary", S_IRUGO, radio->debugfs, radio,
radio->debugfs, radio, &radio_rsq_primary_fops);
&radio_rsq_primary_fops);
if (IS_ERR(dentry)) {
ret = PTR_ERR(dentry);
goto cleanup;
}
return 0;
cleanup:
debugfs_remove_recursive(radio->debugfs);
exit:
return ret;
} }
...@@ -1534,11 +1498,7 @@ static int si476x_radio_probe(struct platform_device *pdev) ...@@ -1534,11 +1498,7 @@ static int si476x_radio_probe(struct platform_device *pdev)
goto exit; goto exit;
} }
rval = si476x_radio_init_debugfs(radio); si476x_radio_init_debugfs(radio);
if (rval < 0) {
dev_err(&pdev->dev, "Could not create debugfs interface\n");
goto exit;
}
return 0; return 0;
exit: exit:
......
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