From: Markus Pargmann Date: Fri, 10 Apr 2015 13:23:42 +0000 (+0200) Subject: regulator: max8660: Handle empty regulator data X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c0cf5a59fb69527151eb8e332a1b9660200f66c6;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git regulator: max8660: Handle empty regulator data 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 Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index f187c8f13e22..4071d74fa828 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c @@ -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: