[PATCH] drivers: regulator: core: remove return value check of `regulator_init`

From: Yuchen Yang
Date: Sun Apr 23 2023 - 08:29:37 EST


Smatch complains that:
regulator_init() warn: 'debugfs_root' 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")
Signed-off-by: Yuchen Yang <u202114568@xxxxxxxxxxx>
Reviewed-by: Dongliang Mu <dzm91@xxxxxxxxxxx>
---
drivers/regulator/core.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 4fcd36055b02..b14f281b1a97 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -6109,8 +6109,6 @@ static int __init regulator_init(void)
ret = class_register(&regulator_class);

debugfs_root = debugfs_create_dir("regulator", NULL);
- if (!debugfs_root)
- pr_warn("regulator: Failed to create debugfs directory\n");

#ifdef CONFIG_DEBUG_FS
debugfs_create_file("supply_map", 0444, debugfs_root, NULL,
--
2.25.1