Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 82874ba4 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown
Browse files

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: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9df3bb31
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -2058,14 +2058,6 @@ 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);

		/* remove any sysfs entries */