lkml.org 
[lkml]   [2019]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] regulator: of: Hide wrong warning regarding suspend state configuration
Date
A "No configuration" warning is falsely emitted in the case when the
of-property regulator-always-on is set but regulator-(on|off)-in-suspend
isn't set.
This patch fixes the warning by explicitly setting always-on regulator's
states to ENABLE_IN_SUSPEND.

Signed-off-by: Robert Karszniewicz <r.karszniewicz@phytec.de>
---
Tested on v4.19.67, applies cleanly on v5.5-rc2.

drivers/regulator/of_regulator.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 210fc20..3acb1571 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -188,8 +188,14 @@ static void of_get_regulation_constraints(struct device_node *np,
continue;
}

+ if (!suspend_state)
+ continue;
+
+ if (constraints->always_on)
+ suspend_state->enabled = ENABLE_IN_SUSPEND;
+
suspend_np = of_get_child_by_name(np, regulator_states[i]);
- if (!suspend_np || !suspend_state)
+ if (!suspend_np)
continue;

if (!of_property_read_u32(suspend_np, "regulator-mode",
--
2.7.4
\
 
 \ /
  Last update: 2019-12-16 18:21    [W:0.043 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site