mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 <[email protected]> Acked-by: Jon Hunter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
20133bd5eb
commit
9b88226924
1 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue