From: Mark Brown Date: Mon, 14 May 2012 12:24:13 +0000 (+0100) Subject: regulator: wm8994: Allow registration with no platform data X-Git-Tag: v3.5-rc1~177^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b68b45d77d7c23c6d92576d494796912883be4e1;p=profile%2Fivi%2Fkernel-x86-ivi.git regulator: wm8994: Allow registration with no platform data Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 7c64ce5..9a99431 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c @@ -168,9 +168,6 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1); - if (!pdata) - return -ENODEV; - ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm8994_ldo), GFP_KERNEL); if (ldo == NULL) { dev_err(&pdev->dev, "Unable to allocate private data\n"); @@ -192,9 +189,10 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev) ldo->is_enabled = true; config.dev = wm8994->dev; - config.init_data = pdata->ldo[id].init_data; config.driver_data = ldo; config.regmap = wm8994->regmap; + if (pdata) + config.init_data = pdata->ldo[id].init_data; ldo->regulator = regulator_register(&wm8994_ldo_desc[id], &config); if (IS_ERR(ldo->regulator)) {