aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-dcdc.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-14 06:37:09 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-14 06:41:36 -0400
commitf0b067d9b6474e5309dd47ab30264cd0a48d4963 (patch)
tree96c4f849fedcaf2763a38379850edd2239829738 /drivers/regulator/wm831x-dcdc.c
parentcd8318cb9e8dea0dcf8ccb15955b48d14ba51e52 (diff)
regulator: wm831x-dcdc: Add missing checks for pdata before use
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/wm831x-dcdc.c')
-rw-r--r--drivers/regulator/wm831x-dcdc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index 8710cfb0c19b..a885911bb5fc 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -518,7 +518,7 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
518 } 518 }
519 dcdc->dvs_vsel = ret & WM831X_DC1_DVS_VSEL_MASK; 519 dcdc->dvs_vsel = ret & WM831X_DC1_DVS_VSEL_MASK;
520 520
521 if (pdata->dcdc[id]) 521 if (pdata && pdata->dcdc[id])
522 wm831x_buckv_dvs_init(dcdc, pdata->dcdc[id]->driver_data); 522 wm831x_buckv_dvs_init(dcdc, pdata->dcdc[id]->driver_data);
523 523
524 config.dev = pdev->dev.parent; 524 config.dev = pdev->dev.parent;
@@ -846,7 +846,8 @@ static __devinit int wm831x_boostp_probe(struct platform_device *pdev)
846 dcdc->desc.enable_mask = 1 << id; 846 dcdc->desc.enable_mask = 1 << id;
847 847
848 config.dev = pdev->dev.parent; 848 config.dev = pdev->dev.parent;
849 config.init_data = pdata->dcdc[id]; 849 if (pdata)
850 config.init_data = pdata->dcdc[id];
850 config.driver_data = dcdc; 851 config.driver_data = dcdc;
851 config.regmap = wm831x->regmap; 852 config.regmap = wm831x->regmap;
852 853