regulator: More explict error reporting for fixed regulator
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 3 Aug 2009 17:49:53 +0000 (18:49 +0100)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Tue, 22 Sep 2009 12:32:40 +0000 (13:32 +0100)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/fixed.c

index cdc674f..9c7f956 100644 (file)
@@ -70,12 +70,14 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
 
        drvdata = kzalloc(sizeof(struct fixed_voltage_data), GFP_KERNEL);
        if (drvdata == NULL) {
+               dev_err(&pdev->dev, "Failed to allocate device data\n");
                ret = -ENOMEM;
                goto err;
        }
 
        drvdata->desc.name = kstrdup(config->supply_name, GFP_KERNEL);
        if (drvdata->desc.name == NULL) {
+               dev_err(&pdev->dev, "Failed to allocate supply name\n");
                ret = -ENOMEM;
                goto err;
        }
@@ -90,6 +92,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
                                          config->init_data, drvdata);
        if (IS_ERR(drvdata->dev)) {
                ret = PTR_ERR(drvdata->dev);
+               dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret);
                goto err_name;
        }