[PATCH] regulator: core: remove lockdep assert from suspend_prepare
From: Tero Kristo
Date: Mon Apr 18 2016 - 07:49:53 EST
suspend_prepare can be called during regulator init time also, where
the mutex is not locked yet. This causes a false lockdep warning.
To avoid the problem, remove the lockdep assertion from the function
causing the issue. An alternative would be to lock the mutex during
init, but this would cause other problems (some APIs used during init
will attempt to lock the mutex also, causing deadlock.)
Signed-off-by: Tero Kristo <t-kristo@xxxxxx>
Reported-by: Tomi Valkeinen <tomi.valkeinen@xxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
drivers/regulator/core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6dd63523bcfe..f28fca4b68e3 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -808,8 +808,6 @@ static int suspend_set_state(struct regulator_dev *rdev,
/* locks held by caller */
static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state)
{
- lockdep_assert_held_once(&rdev->mutex);
-
if (!rdev->constraints)
return -EINVAL;
--
2.8.0.rc3