linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] media: cec: no need to check return value of debugfs_create functions
@ 2020-08-18 13:36 Greg Kroah-Hartman
  2020-08-18 13:36 ` [PATCH 2/7] media: coda: " Greg Kroah-Hartman
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Greg Kroah-Hartman @ 2020-08-18 13:36 UTC (permalink / raw)
  To: linux-media
  Cc: Greg Kroah-Hartman, Hans Verkuil, Mauro Carvalho Chehab, linux-kernel

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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/media/cec/core/cec-core.c | 27 ++++++++-------------------
 include/media/cec.h               |  2 --
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c
index c599cd94dd62..562792f545ac 100644
--- a/drivers/media/cec/core/cec-core.c
+++ b/drivers/media/cec/core/cec-core.c
@@ -359,27 +359,16 @@ int cec_register_adapter(struct cec_adapter *adap,
 	if (!top_cec_dir)
 		return 0;
 
-	adap->cec_dir = debugfs_create_dir(dev_name(&adap->devnode.dev), top_cec_dir);
-	if (IS_ERR_OR_NULL(adap->cec_dir)) {
-		pr_warn("cec-%s: Failed to create debugfs dir\n", adap->name);
-		return 0;
-	}
-	adap->status_file = debugfs_create_devm_seqfile(&adap->devnode.dev,
-		"status", adap->cec_dir, cec_adap_status);
-	if (IS_ERR_OR_NULL(adap->status_file)) {
-		pr_warn("cec-%s: Failed to create status file\n", adap->name);
-		debugfs_remove_recursive(adap->cec_dir);
-		adap->cec_dir = NULL;
-		return 0;
-	}
+	adap->cec_dir = debugfs_create_dir(dev_name(&adap->devnode.dev),
+					   top_cec_dir);
+
+	debugfs_create_devm_seqfile(&adap->devnode.dev, "status", adap->cec_dir,
+				    cec_adap_status);
+
 	if (!adap->ops->error_inj_show || !adap->ops->error_inj_parse_line)
 		return 0;
-	adap->error_inj_file = debugfs_create_file("error-inj", 0644,
-						   adap->cec_dir, adap,
-						   &cec_error_inj_fops);
-	if (IS_ERR_OR_NULL(adap->error_inj_file))
-		pr_warn("cec-%s: Failed to create error-inj file\n",
-			adap->name);
+	debugfs_create_file("error-inj", 0644, adap->cec_dir, adap,
+			    &cec_error_inj_fops);
 #endif
 	return 0;
 }
diff --git a/include/media/cec.h b/include/media/cec.h
index c48b5f2e4b50..cd35ae6b7560 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -248,8 +248,6 @@ struct cec_adapter {
 #endif
 
 	struct dentry *cec_dir;
-	struct dentry *status_file;
-	struct dentry *error_inj_file;
 
 	u32 sequence;
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-09-17 12:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 13:36 [PATCH 1/7] media: cec: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 2/7] media: coda: " Greg Kroah-Hartman
2020-08-18 13:56   ` Philipp Zabel
2020-08-18 13:36 ` [PATCH 3/7] media: exynos4-is: " Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 4/7] media: mtk-vpu: " Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 5/7] media: sti: " Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 6/7] media: radio: si476x: " Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 7/7] media: usb: uvc: " Greg Kroah-Hartman
2020-08-18 23:47   ` Laurent Pinchart
2020-09-17 12:25     ` Laurent Pinchart
2020-09-17 12:34       ` Greg Kroah-Hartman
2020-09-17 12:37         ` Laurent Pinchart
2020-09-17 12:46           ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).