mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
	olof@lixom.net, Doug Anderson <dianders@chromium.org>,
	lgirdwood@gmail.com, linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: tps65090: Fix tps65090 crash on Tegra Dalmore
Date: Thu,  1 May 2014 11:50:16 -0700	[thread overview]
Message-ID: <1398970216-23519-1-git-send-email-dianders@chromium.org> (raw)

The patch (60e91b5 regulator: tps65090: Allow setting the overcurrent
wait time) introduced a crash on Tegra Dalmore.  On Dalmore the device
tree doesn't have an entry for all of the FETs so it leaves tps_pdata
NULL in some cases.  Add a check for NULL like the rest of the code
does.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/regulator/tps65090-regulator.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index ca04e9f..fbe0bf5 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -306,8 +306,11 @@ static int tps65090_regulator_probe(struct platform_device *pdev)
 		ri = &pmic[num];
 		ri->dev = &pdev->dev;
 		ri->desc = &tps65090_regulator_desc[num];
-		ri->overcurrent_wait_valid = tps_pdata->overcurrent_wait_valid;
-		ri->overcurrent_wait = tps_pdata->overcurrent_wait;
+		if (tps_pdata) {
+			ri->overcurrent_wait_valid =
+				tps_pdata->overcurrent_wait_valid;
+			ri->overcurrent_wait = tps_pdata->overcurrent_wait;
+		}
 
 		/*
 		 * TPS5090 DCDC support the control from external digital input.
-- 
1.9.1.423.g4596e3a


             reply	other threads:[~2014-05-01 18:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01 18:50 Doug Anderson [this message]
2014-05-01 18:59 ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398970216-23519-1-git-send-email-dianders@chromium.org \
    --to=dianders@chromium.org \
    --cc=broonie@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=swarren@wwwdotorg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®