Commit 7f7ae192 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jiri Slaby

regulator: max77693: Fix use of uninitialized regulator config

commit ca0c37a0 upstream.

Driver allocated on stack struct regulator_config but didn't initialize
it fully. Few fields (driver_data, ena_gpio) were left untouched. This
lead to using random ena_gpio values as GPIOs for max77693 regulators.

On occasion these values could match real GPIO numbers leading to
interfering with other drivers and to unsuccessful enable/disable of
regulator.
Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 80b022e2 ("regulator: max77693: Add max77693 regualtor driver.")
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 8f9363f7
...@@ -231,7 +231,7 @@ static int max77693_pmic_probe(struct platform_device *pdev) ...@@ -231,7 +231,7 @@ static int max77693_pmic_probe(struct platform_device *pdev)
struct max77693_pmic_dev *max77693_pmic; struct max77693_pmic_dev *max77693_pmic;
struct max77693_regulator_data *rdata = NULL; struct max77693_regulator_data *rdata = NULL;
int num_rdata, i, ret; int num_rdata, i, ret;
struct regulator_config config; struct regulator_config config = { };
num_rdata = max77693_pmic_init_rdata(&pdev->dev, &rdata); num_rdata = max77693_pmic_init_rdata(&pdev->dev, &rdata);
if (!rdata || num_rdata <= 0) { if (!rdata || num_rdata <= 0) {
......
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