regulator: max8660: Handle empty regulator data
authorMarkus Pargmann <mpa@pengutronix.de>
Fri, 10 Apr 2015 13:23:42 +0000 (15:23 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 10 Apr 2015 17:17:53 +0000 (18:17 +0100)
It is not necessary to have regulator init data for a regulator. This
patch removes the necessity of this data and handles a NULL pointer
properly.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max8660.c

index f187c8f13e22ff11669637714ea51860b3b8504b..4071d74fa8288ce27d2cdd34505c006474e2f869 100644 (file)
@@ -442,9 +442,9 @@ static int max8660_probe(struct i2c_client *client,
        for (i = 0; i < pdata->num_subdevs; i++) {
 
                if (!pdata->subdevs[i].platform_data)
-                       return ret;
-
-               boot_on = pdata->subdevs[i].platform_data->constraints.boot_on;
+                       boot_on = false;
+               else
+                       boot_on = pdata->subdevs[i].platform_data->constraints.boot_on;
 
                switch (pdata->subdevs[i].id) {
                case MAX8660_V3: