Skip to contentSkip to conversation

regulator: wm831x-dcdc: Add missing checks for pdata before use

PATCH New Mark Brown 1 participant 1 message May 14, 2012

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 regulator: wm831x-dcdc: Add missing checks for pdata before use

---
 drivers/regulator/wm831x-dcdc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/regulator/wm831x-dcdc.c +3 -2
index d685911..099da11 100644
@@ -518,7 +518,7 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
 	}
 	dcdc->dvs_vsel = ret & WM831X_DC1_DVS_VSEL_MASK;
 
-	if (pdata->dcdc[id])
+	if (pdata && pdata->dcdc[id])
 		wm831x_buckv_dvs_init(dcdc, pdata->dcdc[id]->driver_data);
 
 	config.dev = pdev->dev.parent;
@@ -851,7 +851,8 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev)
 	dcdc->desc.enable_mask = 1 << id;
 
 	config.dev = pdev->dev.parent;
-	config.init_data = pdata->dcdc[id];
+	if (pdata)
+		config.init_data = pdata->dcdc[id];
 	config.driver_data = dcdc;
 	config.regmap = wm831x->regmap;
 
Signature · 1 line
1.7.10