media: sti: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Aug 2020 13:36:06 +0000 (15:36 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 1 Sep 2020 12:13:26 +0000 (14:13 +0200)
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>
drivers/media/platform/sti/bdisp/bdisp-debug.c
drivers/media/platform/sti/bdisp/bdisp-v4l2.c
drivers/media/platform/sti/bdisp/bdisp.h
drivers/media/platform/sti/hva/hva-debugfs.c

index 77ca751..2b27009 100644 (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)
index af2d5eb..7d50d6c 100644 (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))
index e309cde..3fb009d 100644 (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);
index 7d12a5b..a86a07b 100644 (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)