Explorar o código

regulator: core: Drop references on supply regulator when unregistering

Signed-off-by: Mark Brown <broonie@linaro.org>
Mark Brown %!s(int64=12) %!d(string=hai) anos
pai
achega
891636ea27
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      drivers/regulator/core.c

+ 4 - 1
drivers/regulator/core.c

@@ -3740,8 +3740,11 @@ void regulator_unregister(struct regulator_dev *rdev)
 	if (rdev == NULL)
 		return;
 
-	if (rdev->supply)
+	if (rdev->supply) {
+		while (rdev->use_count--)
+			regulator_disable(rdev->supply);
 		regulator_put(rdev->supply);
+	}
 	mutex_lock(&regulator_list_mutex);
 	debugfs_remove_recursive(rdev->debugfs);
 	flush_work(&rdev->disable_work.work);