mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
regulator: core: Ensure debugfs is fully initialized
regulator->debugfs is NULL when sysfs_create_link_nowarn() return -EEXIST, and triggering the following warning: [ 2.426974] debugfs: File 'uA_load' in directory '/' already present! [ 2.426983] debugfs: File 'min_uV' in directory '/' already present! [ 2.426991] debugfs: File 'max_uV' in directory '/' already present! [ 2.426999] debugfs: File 'constraint_flags' in directory '/' already present! Fixes:08880713ce("regulator: core: Streamline debugfs operations") Fixes:2715bb11cf("regulator: core: Fix more error checking for debugfs_create_dir()") Signed-off-by: Tao Huang <huangtao@rock-chips.com> Change-Id: Iab0b91cacba410705a643d7198eee4f70e1108d5
This commit is contained in:
@@ -1924,6 +1924,8 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
|
||||
|
||||
if (err != -EEXIST)
|
||||
regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs);
|
||||
else
|
||||
regulator->debugfs = ERR_PTR(err);
|
||||
if (IS_ERR(regulator->debugfs))
|
||||
rdev_dbg(rdev, "Failed to create debugfs directory\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user