summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-07-24 16:55:06 +0200
committerLinus Walleij <linus.walleij@linaro.org>2017-08-14 15:01:13 +0200
commit9b88226924cf640059aacba7af23d048c6ec03b1 (patch)
tree1473228deb38ebf4711e3655230a024b8912c0be /drivers/gpio
parent20133bd5ebbb58cdf224c769dea2a475c746bc1a (diff)
gpio: tegra: Prefer kcalloc() over kzalloc() with multiplies
Rather than manually compute the size of an array, pass the number and element size to kcalloc(). Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-tegra.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index c68455b7e26e..17a664118a97 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -622,10 +622,10 @@ static int tegra_gpio_probe(struct platform_device *pdev)
if (tgi->soc->debounce_supported)
tgi->gc.set_config = tegra_gpio_set_config;
- tgi->bank_info = devm_kzalloc(&pdev->dev, tgi->bank_count *
+ tgi->bank_info = devm_kcalloc(&pdev->dev, tgi->bank_count,
sizeof(*tgi->bank_info), GFP_KERNEL);
if (!tgi->bank_info)
- return -ENODEV;
+ return -ENOMEM;
tgi->irq_domain = irq_domain_add_linear(pdev->dev.of_node,
tgi->gc.ngpio,