Messages in this thread Patch in this message | | | From | Yuchen Yang <> | Subject | [PATCH] drivers: regulator: core: remove return value check of `rdev->debugfs` | Date | Mon, 24 Apr 2023 10:57:37 +0800 |
| |
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@hust.edu.cn> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn> --- 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
| |