Commit 446925f1 authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Thierry Reding

pwm: pwm-mediatek: Allocate clk_pwms with devm_kmalloc_array

Switch from devm_kcalloc to devm_kmalloc_array when allocating clk_pwms,
as this structure is being filled right after allocating it, hence
there is no need to zero it out beforehand.
Signed-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 5264e8ca
......@@ -221,7 +221,7 @@ static int pwm_mediatek_probe(struct platform_device *pdev)
if (IS_ERR(pc->regs))
return PTR_ERR(pc->regs);
pc->clk_pwms = devm_kcalloc(&pdev->dev, pc->soc->num_pwms,
pc->clk_pwms = devm_kmalloc_array(&pdev->dev, pc->soc->num_pwms,
sizeof(*pc->clk_pwms), GFP_KERNEL);
if (!pc->clk_pwms)
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