[PATCH v2] HSI: omap-ssi: Remove unnecessary debugfs_create_dir() error check

Yang Ruibin posted 1 patch 1 year, 3 months ago
drivers/hsi/controllers/omap_ssi_core.c | 8 --------
1 file changed, 8 deletions(-)
[PATCH v2] HSI: omap-ssi: Remove unnecessary debugfs_create_dir() error check
Posted by Yang Ruibin 1 year, 3 months ago
Remove the debugfs_create_dir() error check. It's safe to pass in error
pointers to the debugfs API, hence the user isn't supposed to include
error checking of the return values.

Signed-off-by: Yang Ruibin <11162571@vivo.com>
---
Changes v2:
-Remove debugfs_create_dir() error check
---
 drivers/hsi/controllers/omap_ssi_core.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c
index 3140990a6..6318506b4 100644
--- a/drivers/hsi/controllers/omap_ssi_core.c
+++ b/drivers/hsi/controllers/omap_ssi_core.c
@@ -116,22 +116,14 @@ 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);
 	/* SSI GDD (DMA) */
 	dir = debugfs_create_dir("gdd", omap_ssi->dir);
-	if (!dir)
-		goto rback;
 	debugfs_create_file("regs", S_IRUGO, dir, ssi, &ssi_gdd_regs_fops);
 
 	return 0;
-rback:
-	debugfs_remove_recursive(omap_ssi->dir);
-
-	return -ENOMEM;
 }
 
 static void ssi_debug_remove_ctrl(struct hsi_controller *ssi)
-- 
2.34.1
Re: [PATCH v2] HSI: omap-ssi: Remove unnecessary debugfs_create_dir() error check
Posted by Sebastian Reichel 1 year, 3 months ago
On Tue, 27 Aug 2024 20:08:16 +0800, Yang Ruibin wrote:
> Remove the debugfs_create_dir() error check. It's safe to pass in error
> pointers to the debugfs API, hence the user isn't supposed to include
> error checking of the return values.
> 
> 

Applied, thanks!

[1/1] HSI: omap-ssi: Remove unnecessary debugfs_create_dir() error check
      commit: c3eddf5e8c30adb6f43fc0b149e88b9feb76f381

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>