diff mbox series

pktcdvd.c: Drop error checking for debugfs_create_dir

Message ID 20230525175836.19058-1-osmtendev@gmail.com (mailing list archive)
State New, archived
Headers show
Series pktcdvd.c: Drop error checking for debugfs_create_dir | expand

Commit Message

Osama Muhammad May 25, 2023, 5:58 p.m. UTC
This patch remove the error checking in pktcdvd.c.
The DebugFS kernel API is developed in
a way that the caller can safely ignore the errors that
occur during the creation of DebugFS nodes.

The comment above debugfs_create_dir includes the following text.

 * NOTE: it's expected that most callers should _ignore_ the errors returned
 * by this function. Other debugfs functions handle the fact that the "dentry"
 * passed to them could be an error and they don't crash in that case.
 * Drivers should generally work fine even if debugfs fails to init anyway.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
---
 drivers/block/pktcdvd.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index d5d7884cedd4..37cdd68c3de5 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -451,8 +451,6 @@  static void pkt_debugfs_dev_new(struct pktcdvd_device *pd)
 	if (!pkt_debugfs_root)
 		return;
 	pd->dfs_d_root = debugfs_create_dir(pd->name, pkt_debugfs_root);
-	if (!pd->dfs_d_root)
-		return;
 
 	pd->dfs_f_info = debugfs_create_file("info", 0444,
 					     pd->dfs_d_root, pd, &debug_fops);