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


Groups > linux.kernel > #1431973

[PATCH 1/1] regulator: max77620: check for valid regulator info

From Venkat Reddy Talla <vreddytalla@nvidia.com>
Newsgroups linux.kernel
Subject [PATCH 1/1] regulator: max77620: check for valid regulator info
Date 2016-06-27 13:50 +0200
Message-ID <rODd7-86Z-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Check for valid regulator information data before
configuring FPS source and FPS power up/down
period to avoid NULL pointer exception if entries for
PMIC regulators not provided through device tree.
SD4 regulator is not supported by MAX77620 PMIC, removing
SD4 entry from regulator information list.

Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
---
 drivers/regulator/max77620-regulator.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c
index 321e804..a1b49a6 100644
--- a/drivers/regulator/max77620-regulator.c
+++ b/drivers/regulator/max77620-regulator.c
@@ -123,6 +123,9 @@ static int max77620_regulator_set_fps_src(struct max77620_regulator *pmic,
 	unsigned int val;
 	int ret;
 
+	if (!rinfo)
+		return 0;
+
 	switch (fps_src) {
 	case MAX77620_FPS_SRC_0:
 	case MAX77620_FPS_SRC_1:
@@ -171,6 +174,9 @@ static int max77620_regulator_set_fps_slots(struct max77620_regulator *pmic,
 	int pd = rpdata->active_fps_pd_slot;
 	int ret = 0;
 
+	if (!rinfo)
+		return 0;
+
 	if (is_suspend) {
 		pu = rpdata->suspend_fps_pu_slot;
 		pd = rpdata->suspend_fps_pd_slot;
@@ -680,7 +686,6 @@ static struct max77620_regulator_info max77620_regs_info[MAX77620_NUM_REGS] = {
 	RAIL_SD(SD1, sd1, "in-sd1", SD1, 600000, 1550000, 12500, 0x22, SD1),
 	RAIL_SD(SD2, sd2, "in-sd2", SDX, 600000, 3787500, 12500, 0xFF, NONE),
 	RAIL_SD(SD3, sd3, "in-sd3", SDX, 600000, 3787500, 12500, 0xFF, NONE),
-	RAIL_SD(SD4, sd4, "in-sd4", SDX, 600000, 3787500, 12500, 0xFF, NONE),
 
 	RAIL_LDO(LDO0, ldo0, "in-ldo0-1", N, 800000, 2375000, 25000),
 	RAIL_LDO(LDO1, ldo1, "in-ldo0-1", N, 800000, 2375000, 25000),
-- 
2.1.4

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


Thread

[PATCH 1/1] regulator: max77620: check for valid regulator info Venkat Reddy Talla <vreddytalla@nvidia.com> - 2016-06-27 13:50 +0200
  Re: [PATCH 1/1] regulator: max77620: check for valid regulator info Mark Brown <broonie@kernel.org> - 2016-06-27 18:20 +0200
    RE: [PATCH 1/1] regulator: max77620: check for valid regulator info Venkat Reddy Talla <vreddytalla@nvidia.com> - 2016-06-28 06:40 +0200
      Re: [PATCH 1/1] regulator: max77620: check for valid regulator info Mark Brown <broonie@kernel.org> - 2016-06-28 21:40 +0200
  Applied "regulator: max77620: check for valid regulator info" to the regulator tree Mark Brown <broonie@kernel.org> - 2016-06-29 20:10 +0200

csiph-web