From: Tero Kristo Date: Mon, 18 Apr 2016 11:49:53 +0000 (+0300) Subject: UPSTREAM: regulator: core: remove lockdep assert from suspend_prepare X-Git-Tag: firefly_0821_release~1510 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c1834e4eb46756c7bdf6a92b27830f04922772dd;p=firefly-linux-kernel-4.4.55.git UPSTREAM: regulator: core: remove lockdep assert from suspend_prepare 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.) Change-Id: I4a4367f3ebc9c7a00d6a08b547f2cebecd600483 Signed-off-by: Tero Kristo Reported-by: Tomi Valkeinen Signed-off-by: Mark Brown Signed-off-by: Huang, Tao (cherry picked from commit 07c5c3ad98926dc15d31aa86de62fd4170f2a745) --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 732ac71b82cd..a63aa1c9bb12 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;