Skip to contentSkip to conversation

hsi: controllers: Remove error checking for debugfs_create_dir()

PATCH Superseded Wang Ming 2 participants 2 messages Jul 26, 2023 – Jul 31, 2023 HSI

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Wang Ming

author
#0 lore raw

PATCH v2 1/1 hsi: controllers: Remove error checking for debugfs_create_dir()

It is expected that most callers should _ignore_ the errors return by debugfs_create_dir() in bond_debug_reregister().

---
 drivers/hsi/controllers/omap_ssi_core.c | 2 --
 1 file changed, 2 deletions(-)
drivers/hsi/controllers/omap_ssi_core.c +0 -2
index 84ba8b875..57c63053f 100644
@@ -115,8 +115,6 @@ static int ssi_debug_add_ctrl(struct hsi_controller *ssi)
 
 	/* SSI controller */
 	omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL);
-	if (!omap_ssi->dir)
-		return -ENOMEM;
 
 	debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi,
 								&ssi_regs_fops);
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 2 lines · Wang Ming

It is expected that most callers should _ignore_ the errors return by debugfs_create_dir() in bond_debug_reregister().

bond_debug_reregister()?

drivers/hsi/controllers/omap_ssi_core.c static int ssi_debug_add_ctrl(struct hsi_controller *ssi)

Quoted 10 lines
---
 drivers/hsi/controllers/omap_ssi_core.c | 2 --
 1 file changed, 2 deletions(-)
drivers/hsi/controllers/omap_ssi_core.c +0 -0
index 84ba8b875..57c63053f 100644
@@ -115,8 +115,6 @@ static int ssi_debug_add_ctrl(struct hsi_controller *ssi)

function can become void, if errors are ignored.

drivers/hsi/controllers/omap_ssi_core.c static int ssi_debug_add_ctrl(struct hsi_controller *ssi) · line 119

Quoted 5 lines
drivers/hsi/controllers/omap_ssi_core.c +0 -2
 	/* SSI controller */
 	omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL);
-	if (!omap_ssi->dir)
-		return -ENOMEM;

What about the second debugfs_create_dir() call in the same function?

drivers/hsi/controllers/omap_ssi_core.c static int ssi_debug_add_ctrl(struct hsi_controller *ssi) · line 120

Quoted 3 lines
drivers/hsi/controllers/omap_ssi_core.c +0 -0
 	debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi,
 								&ssi_regs_fops);

-- Sebastian