regulator: core: remove lockdep assert from suspend_prepare
authorTero Kristo <t-kristo@ti.com>
Mon, 18 Apr 2016 11:49:53 +0000 (14:49 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 18 Apr 2016 17:13:24 +0000 (18:13 +0100)
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@ti.com>
Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c

index 6dd63523bcfe4f1f105c42f61fd2ab5cd504ed94..f28fca4b68e34cccb7ec025fb662d3d40ce6d6d5 100644 (file)
@@ -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;