[PATCH] drivers: regulator: core: remove return value check of `rdev->debugfs`

From: Yuchen Yang
Date: Sun Apr 23 2023 - 22:59:55 EST


Smatch complains that:
rdev_init_debugfs() warn: 'rdev->debugfs' is an error pointer or valid

According to the documentation of the debugfs_create_dir() function,
there is no need to check the return value of this function.
Just delete the dead code.

Fixes: 247514344492 ("regulator: Remove ifdefs for debugfs code")
Fixes: 1130e5b3ff4a ("regulator: Add initial per-regulator debugfs support")
Signed-off-by: Yuchen Yang <u202114568@xxxxxxxxxxx>
Reviewed-by: Dongliang Mu <dzm91@xxxxxxxxxxx>
---
drivers/regulator/core.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 4fcd36055b02..979ee043f7a1 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -5188,10 +5188,6 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
}

rdev->debugfs = debugfs_create_dir(rname, debugfs_root);
- if (!rdev->debugfs) {
- rdev_warn(rdev, "Failed to create debugfs directory\n");
- return;
- }

debugfs_create_u32("use_count", 0444, rdev->debugfs,
&rdev->use_count);
--
2.25.1