Skip to contentSkip to conversation

regulator: tps65090: Fix tps65090 crash on Tegra Dalmore

PATCH In review Doug Anderson 2 participants 2 messages May 1, 2014 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/regulator/tps65090-regulator.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/regulator/tps65090-regulator.c +5 -2
index ca04e9f..fbe0bf5 100644
@@ -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.
Signature · 1 line
1.9.1.423.g4596e3a
Tested-by on v1 1/1
#1 lore raw
Quoted 5 lines · Doug Anderson

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.