From f0b067d9b6474e5309dd47ab30264cd0a48d4963 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 14 May 2012 11:37:09 +0100 Subject: [PATCH] regulator: wm831x-dcdc: Add missing checks for pdata before use Signed-off-by: Mark Brown --- drivers/regulator/wm831x-dcdc.c | 5 +++-- 1 file 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) } 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; @@ -846,7 +846,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; -- 2.20.1