|
@@ -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(®ulator_list_mutex);
|
|
|
debugfs_remove_recursive(rdev->debugfs);
|
|
|
flush_work(&rdev->disable_work.work);
|