Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: core: Drop references on supply regulator when unregistering

Signed-off-by: Mark Brown <broonie@linaro.org>

+4 -1
+4 -1
drivers/regulator/core.c
··· 3740 3740 if (rdev == NULL) 3741 3741 return; 3742 3742 3743 - if (rdev->supply) 3743 + if (rdev->supply) { 3744 + while (rdev->use_count--) 3745 + regulator_disable(rdev->supply); 3744 3746 regulator_put(rdev->supply); 3747 + } 3745 3748 mutex_lock(&regulator_list_mutex); 3746 3749 debugfs_remove_recursive(rdev->debugfs); 3747 3750 flush_work(&rdev->disable_work.work);