Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Doug Anderson and committed by
Mark Brown
c122c5b6 ed11f1ea

+5 -2
+5 -2
drivers/regulator/tps65090-regulator.c
··· 431 431 ri = &pmic[num]; 432 432 ri->dev = &pdev->dev; 433 433 ri->desc = &tps65090_regulator_desc[num]; 434 - ri->overcurrent_wait_valid = tps_pdata->overcurrent_wait_valid; 435 - ri->overcurrent_wait = tps_pdata->overcurrent_wait; 434 + if (tps_pdata) { 435 + ri->overcurrent_wait_valid = 436 + tps_pdata->overcurrent_wait_valid; 437 + ri->overcurrent_wait = tps_pdata->overcurrent_wait; 438 + } 436 439 437 440 /* 438 441 * TPS5090 DCDC support the control from external digital input.