regulator: s2mps11: Fix GPIO descriptor initialization

GPIO descriptor array must be zero initialized to ensure that core will
properly handle also the case when no external GPIO pin is defined.

Fixes: 1c984942f0 ("regulator: s2mps11: Pass descriptor instead of GPIO number")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Marek Szyprowski 2018-11-20 13:38:44 +01:00 committed by Mark Brown
parent ffb8c1e45e
commit d7c7fc442f
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 3 deletions

View File

@ -1134,9 +1134,8 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
return -EINVAL;
}
s2mps11->ext_control_gpiod = devm_kmalloc_array(&pdev->dev,
rdev_num, sizeof(*s2mps11->ext_control_gpiod),
GFP_KERNEL);
s2mps11->ext_control_gpiod = devm_kcalloc(&pdev->dev, rdev_num,
sizeof(*s2mps11->ext_control_gpiod), GFP_KERNEL);
if (!s2mps11->ext_control_gpiod)
return -ENOMEM;