Re: [PATCH 3/7] regulator: core: Don't double-disable supplies in regulator_disable_deferred()

From: Dmitry Osipenko
Date: Mon Nov 19 2018 - 19:45:46 EST


On 20.11.2018 3:26, Douglas Anderson wrote:
> In the commit f8702f9e4aa7 ("regulator: core: Use ww_mutex for
> regulators locking") disabling of the supply was moved into
> _regulator_disable(). That means regulator_disable_work() shouldn't
> be disabling since that double-disables the supply.
>
> Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking")
> Signed-off-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
> ---
>
> drivers/regulator/core.c | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index 0052bbc8c531..63a8af1e2256 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -2703,16 +2703,6 @@ static void regulator_disable_work(struct work_struct *work)
> regulator_balance_voltage(rdev, PM_SUSPEND_ON);
>
> regulator_unlock_dependent(rdev, &ww_ctx);
> -
> - if (rdev->supply) {
> - for (i = 0; i < count; i++) {
> - ret = regulator_disable(rdev->supply);
> - if (ret != 0) {
> - rdev_err(rdev,
> - "Supply disable failed: %d\n", ret);
> - }
> - }
> - }
> }
>
> /**
>

Good catch!

Reviewed-by: Dmitry Osipenko <digetx@xxxxxxxxx>