regulator: s2mps11: Don't zero allocated memory for external control
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Thu, 16 Oct 2014 08:23:28 +0000 (10:23 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 20 Oct 2014 11:24:04 +0000 (12:24 +0100)
The driver was allocating memory for storing GPIOs for external control
with unnecessary GFP_ZERO flag. Then right after allocation it
initialized memory to -EINVAL in loop. Skip the GFP_ZERO flag.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/s2mps11.c

index adab82d5279f0696319f53d04e30b07615121dbb..7f59e67252e71db0dc8b7d86675ccb1129937f59 100644 (file)
@@ -845,7 +845,7 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
                return -EINVAL;
        };
 
-       s2mps11->ext_control_gpio = devm_kzalloc(&pdev->dev,
+       s2mps11->ext_control_gpio = devm_kmalloc(&pdev->dev,
                        sizeof(*s2mps11->ext_control_gpio) * s2mps11->rdev_num,
                        GFP_KERNEL);
        if (!s2mps11->ext_control_gpio)