Commit 8c23f411 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Mauro Carvalho Chehab

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: 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 87a9672c
...@@ -637,35 +637,18 @@ DEFINE_SHOW_ATTRIBUTE(last_nodes_raw); ...@@ -637,35 +637,18 @@ DEFINE_SHOW_ATTRIBUTE(last_nodes_raw);
DEFINE_SHOW_ATTRIBUTE(last_request); DEFINE_SHOW_ATTRIBUTE(last_request);
DEFINE_SHOW_ATTRIBUTE(perf); DEFINE_SHOW_ATTRIBUTE(perf);
int bdisp_debugfs_create(struct bdisp_dev *bdisp) void bdisp_debugfs_create(struct bdisp_dev *bdisp)
{ {
char dirname[16]; char dirname[16];
snprintf(dirname, sizeof(dirname), "%s%d", BDISP_NAME, bdisp->id); snprintf(dirname, sizeof(dirname), "%s%d", BDISP_NAME, bdisp->id);
bdisp->dbg.debugfs_entry = debugfs_create_dir(dirname, NULL); bdisp->dbg.debugfs_entry = debugfs_create_dir(dirname, NULL);
if (!bdisp->dbg.debugfs_entry)
goto err;
if (!bdisp_dbg_create_entry(regs)) bdisp_dbg_create_entry(regs);
goto err; bdisp_dbg_create_entry(last_nodes);
bdisp_dbg_create_entry(last_nodes_raw);
if (!bdisp_dbg_create_entry(last_nodes)) bdisp_dbg_create_entry(last_request);
goto err; bdisp_dbg_create_entry(perf);
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;
} }
void bdisp_debugfs_remove(struct bdisp_dev *bdisp) void bdisp_debugfs_remove(struct bdisp_dev *bdisp)
......
...@@ -1360,11 +1360,7 @@ static int bdisp_probe(struct platform_device *pdev) ...@@ -1360,11 +1360,7 @@ static int bdisp_probe(struct platform_device *pdev)
} }
/* Debug */ /* Debug */
ret = bdisp_debugfs_create(bdisp); bdisp_debugfs_create(bdisp);
if (ret) {
dev_err(dev, "failed to create debugfs\n");
goto err_v4l2;
}
/* Power management */ /* Power management */
pm_runtime_enable(dev); pm_runtime_enable(dev);
...@@ -1401,7 +1397,6 @@ static int bdisp_probe(struct platform_device *pdev) ...@@ -1401,7 +1397,6 @@ static int bdisp_probe(struct platform_device *pdev)
pm_runtime_put(dev); pm_runtime_put(dev);
err_dbg: err_dbg:
bdisp_debugfs_remove(bdisp); bdisp_debugfs_remove(bdisp);
err_v4l2:
v4l2_device_unregister(&bdisp->v4l2_dev); v4l2_device_unregister(&bdisp->v4l2_dev);
err_clk: err_clk:
if (!IS_ERR(bdisp->clock)) if (!IS_ERR(bdisp->clock))
......
...@@ -209,6 +209,6 @@ int bdisp_hw_get_and_clear_irq(struct bdisp_dev *bdisp); ...@@ -209,6 +209,6 @@ int bdisp_hw_get_and_clear_irq(struct bdisp_dev *bdisp);
int bdisp_hw_update(struct bdisp_ctx *ctx); int bdisp_hw_update(struct bdisp_ctx *ctx);
void bdisp_debugfs_remove(struct bdisp_dev *bdisp); 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_begin(struct bdisp_dev *bdisp);
void bdisp_dbg_perf_end(struct bdisp_dev *bdisp); void bdisp_dbg_perf_end(struct bdisp_dev *bdisp);
...@@ -337,25 +337,11 @@ DEFINE_SHOW_ATTRIBUTE(regs); ...@@ -337,25 +337,11 @@ DEFINE_SHOW_ATTRIBUTE(regs);
void hva_debugfs_create(struct hva_dev *hva) void hva_debugfs_create(struct hva_dev *hva)
{ {
hva->dbg.debugfs_entry = debugfs_create_dir(HVA_NAME, NULL); hva->dbg.debugfs_entry = debugfs_create_dir(HVA_NAME, NULL);
if (!hva->dbg.debugfs_entry)
goto err;
if (!hva_dbg_create_entry(device)) hva_dbg_create_entry(device);
goto err; hva_dbg_create_entry(encoders);
hva_dbg_create_entry(last);
if (!hva_dbg_create_entry(encoders)) hva_dbg_create_entry(regs);
goto err;
if (!hva_dbg_create_entry(last))
goto err;
if (!hva_dbg_create_entry(regs))
goto err;
return;
err:
hva_debugfs_remove(hva);
} }
void hva_debugfs_remove(struct hva_dev *hva) void hva_debugfs_remove(struct hva_dev *hva)
......
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