regulator: wm8994: Allow registration with no platform data
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 14 May 2012 12:24:13 +0000 (13:24 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 14 May 2012 14:25:33 +0000 (15:25 +0100)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/wm8994-regulator.c

index 7c64ce599d2a956a656cff9aa39ce0f10781aa1d..9a994316e63c60b748d0afea65ffc123e81fcf09 100644 (file)
@@ -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)) {