[PATCH 5.4 005/132] regulator: remove superfluous lock in regulator_resolve_coupling()

From: Greg Kroah-Hartman
Date: Tue Sep 15 2020 - 20:12:48 EST


From: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>

[ Upstream commit a577f3456c0a2fac3dee037c483753e6e68f3e49 ]

The code modifies rdev, but locks c_rdev instead. Remove the lock
as this is held together by regulator_list_mutex taken in the caller.

Fixes: f9503385b187 ("regulator: core: Mutually resolve regulators coupling")
Signed-off-by: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
Reviewed-by: Dmitry Osipenko <digetx@xxxxxxxxx>
Link: https://lore.kernel.org/r/25eb81cefb37a646f3e44eaaf1d8ae8881cfde52.1597195321.git.mirq-linux@xxxxxxxxxxxx
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/regulator/core.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 19826641881bb..c457fa3b8c3e6 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4868,13 +4868,9 @@ static void regulator_resolve_coupling(struct regulator_dev *rdev)
return;
}

- regulator_lock(c_rdev);
-
c_desc->coupled_rdevs[i] = c_rdev;
c_desc->n_resolved++;

- regulator_unlock(c_rdev);
-
regulator_resolve_coupling(c_rdev);
}
}
--
2.25.1