Commit f0b067d9 authored by Mark Brown's avatar Mark Brown

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

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent cd8318cb
...@@ -518,7 +518,7 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev) ...@@ -518,7 +518,7 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
} }
dcdc->dvs_vsel = ret & WM831X_DC1_DVS_VSEL_MASK; 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); wm831x_buckv_dvs_init(dcdc, pdata->dcdc[id]->driver_data);
config.dev = pdev->dev.parent; config.dev = pdev->dev.parent;
...@@ -846,6 +846,7 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev) ...@@ -846,6 +846,7 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev)
dcdc->desc.enable_mask = 1 << id; dcdc->desc.enable_mask = 1 << id;
config.dev = pdev->dev.parent; config.dev = pdev->dev.parent;
if (pdata)
config.init_data = pdata->dcdc[id]; config.init_data = pdata->dcdc[id];
config.driver_data = dcdc; config.driver_data = dcdc;
config.regmap = wm831x->regmap; config.regmap = wm831x->regmap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment