mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
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>
This commit is contained in:
parent
9df3bb319c
commit
82874ba4c6
1 changed files with 1 additions and 9 deletions
|
@ -2058,15 +2058,7 @@ static void _regulator_put(struct regulator *regulator)
|
|||
debugfs_remove_recursive(regulator->debugfs);
|
||||
|
||||
if (regulator->dev) {
|
||||
int count = 0;
|
||||
struct regulator *r;
|
||||
|
||||
list_for_each_entry(r, &rdev->consumer_list, list)
|
||||
if (r->dev == regulator->dev)
|
||||
count++;
|
||||
|
||||
if (count == 1)
|
||||
device_link_remove(regulator->dev, &rdev->dev);
|
||||
device_link_remove(regulator->dev, &rdev->dev);
|
||||
|
||||
/* remove any sysfs entries */
|
||||
sysfs_remove_link(&rdev->dev.kobj, regulator->supply_name);
|
||||
|
|
Loading…
Reference in a new issue