Skip to content

Commit 82874ba

Browse files
lyakhbroonie
authored andcommitted
regulator: fix device unlinking
Device links are refcounted, device_link_remove() has to be called as many times as device_link_add(). Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 9df3bb3 commit 82874ba

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/regulator/core.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,15 +2058,7 @@ static void _regulator_put(struct regulator *regulator)
20582058
debugfs_remove_recursive(regulator->debugfs);
20592059

20602060
if (regulator->dev) {
2061-
int count = 0;
2062-
struct regulator *r;
2063-
2064-
list_for_each_entry(r, &rdev->consumer_list, list)
2065-
if (r->dev == regulator->dev)
2066-
count++;
2067-
2068-
if (count == 1)
2069-
device_link_remove(regulator->dev, &rdev->dev);
2061+
device_link_remove(regulator->dev, &rdev->dev);
20702062

20712063
/* remove any sysfs entries */
20722064
sysfs_remove_link(&rdev->dev.kobj, regulator->supply_name);

0 commit comments

Comments
 (0)