Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1364924

[PATCH 3/3] regulator: twl: Regulator mode should not depend on regulator enabled state

From Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 3/3] regulator: twl: Regulator mode should not depend on regulator enabled state
Date 2016-03-26 09:40 +0100
Message-ID <rgRVg-6G7-5@gated-at.bofh.it> (permalink)
References <rgRLz-6Ae-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When machine constraints are applied, regulator framework first sets
initial mode (if any) and then enables the regulator if needed. The current
code in twl4030reg_set_mode always checks if the regulator is enabled
before applying the mode. That results in -EACCES error returned for
"always-on" regulators which have "initial-mode" set in the board DTS. Fix
that by removing the unneeded check.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 drivers/regulator/twl-regulator.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index be8d05e..d8f6ad6 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -371,7 +371,6 @@ static int twl4030reg_set_mode(struct regulator_dev *rdev, unsigned mode)
 {
 	struct twlreg_info	*info = rdev_get_drvdata(rdev);
 	unsigned		message;
-	int			status;
 
 	/* We can only set the mode through state machine commands... */
 	switch (mode) {
@@ -385,13 +384,6 @@ static int twl4030reg_set_mode(struct regulator_dev *rdev, unsigned mode)
 		return -EINVAL;
 	}
 
-	/* Ensure the resource is associated with some group */
-	status = twlreg_grp(rdev);
-	if (status < 0)
-		return status;
-	if (!(status & (P3_GRP_4030 | P2_GRP_4030 | P1_GRP_4030)))
-		return -EACCES;
-
 	return twl4030_send_pb_msg(message);
 }
 
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] regulator: twl: Fix regulator mode support Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-03-26 09:30 +0100
  [PATCH 1/3] regulator: twl: Make sure we have access to powerbus before trying to write to it Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-03-26 09:30 +0100
  [PATCH 3/3] regulator: twl: Regulator mode should not depend on regulator enabled state Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-03-26 09:40 +0100
  [PATCH 2/3] regulator: twl: Provide of_map_mode for twl4030 Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-03-26 09:40 +0100
    Re: [PATCH 2/3] regulator: twl: Provide of_map_mode for twl4030 Mark Brown <broonie@kernel.org> - 2016-03-29 09:50 +0200

csiph-web