Commit 7d293f56 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: tps6507x: Fix boot regression due to testing wrong init_data pointer

A NULL init_data once incremented will lead to oops, fix it.

Fixes: f979c08f ("regulator: tps6507x: Convert to regulator core's simplified DT parsing code")
Reported-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Tested-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 49820944
...@@ -403,12 +403,12 @@ static int tps6507x_pmic_probe(struct platform_device *pdev) ...@@ -403,12 +403,12 @@ static int tps6507x_pmic_probe(struct platform_device *pdev)
/* common for all regulators */ /* common for all regulators */
tps->mfd = tps6507x_dev; tps->mfd = tps6507x_dev;
for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) { for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++) {
/* Register the regulators */ /* Register the regulators */
tps->info[i] = info; tps->info[i] = info;
if (init_data && init_data->driver_data) { if (init_data && init_data[i].driver_data) {
struct tps6507x_reg_platform_data *data = struct tps6507x_reg_platform_data *data =
init_data->driver_data; init_data[i].driver_data;
info->defdcdc_default = data->defdcdc_default; info->defdcdc_default = data->defdcdc_default;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment