From 95a293c7ba17253b8cffcacbdd716ebfbfe42587 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Sun, 20 Mar 2016 23:29:45 -0300 Subject: [PATCH 1/4] regulator: Remove unneded check for regulator supply The regulator_resolve_supply() function checks if a supply has been associated with a regulator to avoid enabling it if that is not the case. But the supply was already looked up with regulator_resolve_supply() and set with set_supply() before the check and both return on error. So the fact that this statement has been reached means that neither of them failed and a supply must be associated with the regulator. Signed-off-by: Javier Martinez Canillas Signed-off-by: Mark Brown --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index e0b764284773..6dd63523bcfe 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1532,7 +1532,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) } /* Cascade always-on state to supply */ - if (_regulator_is_enabled(rdev) && rdev->supply) { + if (_regulator_is_enabled(rdev)) { ret = regulator_enable(rdev->supply); if (ret < 0) { _regulator_put(rdev->supply); From 9d2597e8c4e593e4a4dbe70837e9396e53a2665a Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 11 Apr 2016 12:30:59 -0400 Subject: [PATCH 2/4] MAINTAINERS: Add DT bindings to regulator framework entry The regulators DT bindings docs and shared headers used by regulator drivers and DTS are not listed as files for the regulator subsystem. So developers may not know who should receive patches to these dirs unless they rely on the get_maintainer.pl git-fallback option which usually makes more harm than good. This patch makes the correct recipient to be obtained using commands such as scripts/get_maintainer.pl --no-git-fallback. Signed-off-by: Javier Martinez Canillas Signed-off-by: Mark Brown --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a915a32be22b..a5d706699e8a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11778,7 +11778,9 @@ L: linux-kernel@vger.kernel.org W: http://www.slimlogic.co.uk/?p=48 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git S: Supported +F: Documentation/devicetree/bindings/regulator/ F: drivers/regulator/ +F: include/dt-bindings/regulator/ F: include/linux/regulator/ VRF From 07c5c3ad98926dc15d31aa86de62fd4170f2a745 Mon Sep 17 00:00:00 2001 From: Tero Kristo Date: Mon, 18 Apr 2016 14:49:53 +0300 Subject: [PATCH 3/4] 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.) Signed-off-by: Tero Kristo Reported-by: Tomi Valkeinen Signed-off-by: Mark Brown --- 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; From de4a54c4dfaed0604565c1b27488dce56997acc0 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 21 Jan 2016 20:19:41 +0000 Subject: [PATCH 4/4] regulator: core: Use a bitfield for continuous_voltage_range Using a bitfield enables the compiler to lay out the structure more efficiently when we have other boolean flags since multiple values can be included in a single byte. Signed-off-by: Mark Brown --- include/linux/regulator/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index cd271e89a7e6..9ac3f9879576 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -292,7 +292,7 @@ struct regulator_desc { const struct regulator_desc *, struct regulator_config *); int id; - bool continuous_voltage_range; + unsigned int continuous_voltage_range:1; unsigned n_voltages; const struct regulator_ops *ops; int irq;