media: sti: 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:
Greg Kroah-Hartman 2020-08-18 15:36:06 +02:00 committed by Mauro Carvalho Chehab
parent 87a9672c1d
commit 8c23f41129
4 changed files with 12 additions and 48 deletions

View File

@ -637,35 +637,18 @@ DEFINE_SHOW_ATTRIBUTE(last_nodes_raw);
DEFINE_SHOW_ATTRIBUTE(last_request);
DEFINE_SHOW_ATTRIBUTE(perf);
int bdisp_debugfs_create(struct bdisp_dev *bdisp)
void bdisp_debugfs_create(struct bdisp_dev *bdisp)
{
char dirname[16];
snprintf(dirname, sizeof(dirname), "%s%d", BDISP_NAME, bdisp->id);
bdisp->dbg.debugfs_entry = debugfs_create_dir(dirname, NULL);
if (!bdisp->dbg.debugfs_entry)
goto err;
if (!bdisp_dbg_create_entry(regs))
goto err;
if (!bdisp_dbg_create_entry(last_nodes))
goto err;
if (!bdisp_dbg_create_entry(last_nodes_raw))
goto err;
if (!bdisp_dbg_create_entry(last_request))
goto err;
if (!bdisp_dbg_create_entry(perf))
goto err;
return 0;
err:
bdisp_debugfs_remove(bdisp);
return -ENOMEM;
bdisp_dbg_create_entry(regs);
bdisp_dbg_create_entry(last_nodes);
bdisp_dbg_create_entry(last_nodes_raw);
bdisp_dbg_create_entry(last_request);
bdisp_dbg_create_entry(perf);
}
void bdisp_debugfs_remove(struct bdisp_dev *bdisp)

View File

@ -1360,11 +1360,7 @@ static int bdisp_probe(struct platform_device *pdev)
}
/* Debug */
ret = bdisp_debugfs_create(bdisp);
if (ret) {
dev_err(dev, "failed to create debugfs\n");
goto err_v4l2;
}
bdisp_debugfs_create(bdisp);
/* Power management */
pm_runtime_enable(dev);
@ -1401,7 +1397,6 @@ err_pm:
pm_runtime_put(dev);
err_dbg:
bdisp_debugfs_remove(bdisp);
err_v4l2:
v4l2_device_unregister(&bdisp->v4l2_dev);
err_clk:
if (!IS_ERR(bdisp->clock))

View File

@ -209,6 +209,6 @@ int bdisp_hw_get_and_clear_irq(struct bdisp_dev *bdisp);
int bdisp_hw_update(struct bdisp_ctx *ctx);
void bdisp_debugfs_remove(struct bdisp_dev *bdisp);
int bdisp_debugfs_create(struct bdisp_dev *bdisp);
void bdisp_debugfs_create(struct bdisp_dev *bdisp);
void bdisp_dbg_perf_begin(struct bdisp_dev *bdisp);
void bdisp_dbg_perf_end(struct bdisp_dev *bdisp);

View File

@ -337,25 +337,11 @@ DEFINE_SHOW_ATTRIBUTE(regs);
void hva_debugfs_create(struct hva_dev *hva)
{
hva->dbg.debugfs_entry = debugfs_create_dir(HVA_NAME, NULL);
if (!hva->dbg.debugfs_entry)
goto err;
if (!hva_dbg_create_entry(device))
goto err;
if (!hva_dbg_create_entry(encoders))
goto err;
if (!hva_dbg_create_entry(last))
goto err;
if (!hva_dbg_create_entry(regs))
goto err;
return;
err:
hva_debugfs_remove(hva);
hva_dbg_create_entry(device);
hva_dbg_create_entry(encoders);
hva_dbg_create_entry(last);
hva_dbg_create_entry(regs);
}
void hva_debugfs_remove(struct hva_dev *hva)