diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2018-11-20 13:38:44 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-11-20 15:25:40 +0000 |
commit | d7c7fc442fa6f6f0cd0115d7b8dbdf6fe2eeea44 (patch) | |
tree | 82268c0fdbaa7979e0961c0852b05f5d6d9bd60a /drivers/regulator | |
parent | ffb8c1e45e7ae648a3a1689aa71be50fb459316e (diff) |
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: 1c984942f0a4 ("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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/s2mps11.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c index 6fec45897194..63e66f485cc0 100644 --- a/drivers/regulator/s2mps11.c +++ b/drivers/regulator/s2mps11.c @@ -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; |