regulator: core: Drop references on supply regulator when unregistering
authorMark Brown <broonie@linaro.org>
Mon, 8 Jul 2013 08:14:45 +0000 (09:14 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 15 Jul 2013 10:20:08 +0000 (11:20 +0100)
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/core.c

index 288c75abc19034c06e62772ea6b6cc62242da473..1510333bcf0dccc1bf780d168de339f2d54a58dc 100644 (file)
@@ -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);
This page took 0.025558 seconds and 5 git commands to generate.