Commit d7c7fc44 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Mark Brown

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: 1c984942 ("regulator: s2mps11: Pass descriptor instead of GPIO number")
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ffb8c1e4
...@@ -1134,9 +1134,8 @@ static int s2mps11_pmic_probe(struct platform_device *pdev) ...@@ -1134,9 +1134,8 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
s2mps11->ext_control_gpiod = devm_kmalloc_array(&pdev->dev, s2mps11->ext_control_gpiod = devm_kcalloc(&pdev->dev, rdev_num,
rdev_num, sizeof(*s2mps11->ext_control_gpiod), sizeof(*s2mps11->ext_control_gpiod), GFP_KERNEL);
GFP_KERNEL);
if (!s2mps11->ext_control_gpiod) if (!s2mps11->ext_control_gpiod)
return -ENOMEM; return -ENOMEM;
......
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