summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorDoug Anderson <dianders@chromium.org>2014-05-01 20:50:16 +0200
committerMark Brown <broonie@linaro.org>2014-05-02 18:33:30 +0200
commitc122c5b68273cf0153d1dc510889728cf71e8ce3 (patch)
tree03fe6e24730378ef3f48b7e4552a4eb1739d11ad /drivers/regulator
parentregulator: tps65090: Make FETs more reliable by adding retries (diff)
downloadlinux-c122c5b68273cf0153d1dc510889728cf71e8ce3.tar.xz
linux-c122c5b68273cf0153d1dc510889728cf71e8ce3.zip
regulator: tps65090: Fix tps65090 crash on Tegra Dalmore
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. Reported-by: Olof Johansson <olof@lixom.net> Signed-off-by: Doug Anderson <dianders@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/tps65090-regulator.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index 2057e2e311de..2064b3fd45f7 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -431,8 +431,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.