Skip to content

Commit 446925f

Browse files
AngeloGioacchino Del Regnothierryreding
authored andcommitted
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: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent 5264e8c commit 446925f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pwm/pwm-mediatek.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static int pwm_mediatek_probe(struct platform_device *pdev)
221221
if (IS_ERR(pc->regs))
222222
return PTR_ERR(pc->regs);
223223

224-
pc->clk_pwms = devm_kcalloc(&pdev->dev, pc->soc->num_pwms,
224+
pc->clk_pwms = devm_kmalloc_array(&pdev->dev, pc->soc->num_pwms,
225225
sizeof(*pc->clk_pwms), GFP_KERNEL);
226226
if (!pc->clk_pwms)
227227
return -ENOMEM;

0 commit comments

Comments
 (0)