[git:media_tree/master] media: staging: media: imx: no need to check return value of debugfs_create functions

Mauro Carvalho Chehab mchehab+huawei at kernel.org
Tue May 5 15:23:21 UTC 2020


This is an automatic generated email to let you know that the following patch were queued:

Subject: media: staging: media: imx: no need to check return value of debugfs_create functions
Author:  Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Date:    Tue Apr 28 19:04:05 2020 +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.

Cc: Steve Longerbeam <slongerbeam at gmail.com>
Cc: Philipp Zabel <p.zabel at pengutronix.de>
Cc: Shawn Guo <shawnguo at kernel.org>
Cc: Sascha Hauer <s.hauer at pengutronix.de>
Cc: Pengutronix Kernel Team <kernel at pengutronix.de>
Cc: Fabio Estevam <festevam at gmail.com>
Cc: NXP Linux Team <linux-imx at nxp.com>
Cc: devel at driverdev.osuosl.org
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Reviewed-by: Rui Miguel Silva <rmfrfs at gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco at xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei at kernel.org>

 drivers/staging/media/imx/imx7-mipi-csis.c | 29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

---

diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
index e2403b448b6d..ca20f5da9ac6 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -1017,33 +1017,14 @@ static int mipi_csis_dump_regs_show(struct seq_file *m, void *private)
 }
 DEFINE_SHOW_ATTRIBUTE(mipi_csis_dump_regs);
 
-static int mipi_csis_debugfs_init(struct csi_state *state)
+static void mipi_csis_debugfs_init(struct csi_state *state)
 {
-	struct dentry *d;
-
-	if (!debugfs_initialized())
-		return -ENODEV;
-
 	state->debugfs_root = debugfs_create_dir(dev_name(state->dev), NULL);
-	if (!state->debugfs_root)
-		return -ENOMEM;
-
-	d = debugfs_create_bool("debug_enable", 0600, state->debugfs_root,
-				&state->debug);
-	if (!d)
-		goto remove_debugfs;
-
-	d = debugfs_create_file("dump_regs", 0600, state->debugfs_root,
-				state, &mipi_csis_dump_regs_fops);
-	if (!d)
-		goto remove_debugfs;
-
-	return 0;
-
-remove_debugfs:
-	debugfs_remove_recursive(state->debugfs_root);
 
-	return -ENOMEM;
+	debugfs_create_bool("debug_enable", 0600, state->debugfs_root,
+			    &state->debug);
+	debugfs_create_file("dump_regs", 0600, state->debugfs_root, state,
+			    &mipi_csis_dump_regs_fops);
 }
 
 static void mipi_csis_debugfs_exit(struct csi_state *state)


More information about the devel mailing list