mailbox: mtk-cmdq: Remove needless devm_kfree() calls
authorThierry Reding <treding@nvidia.com>
Thu, 20 Dec 2018 17:19:56 +0000 (18:19 +0100)
committerJassi Brar <jaswinder.singh@linaro.org>
Fri, 21 Dec 2018 22:49:25 +0000 (16:49 -0600)
Memory allocated through device-managed functions doesn't need to be
explicitly freed, so these calls can be removed.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/mtk-cmdq-mailbox.c

index d9c3ec3667a8281e91414b080d4ffcfdbd68c745..22811784dc7de9527ddbe60221a8cbb6bac3ca87 100644 (file)
@@ -339,14 +339,6 @@ static int cmdq_remove(struct platform_device *pdev)
 
        clk_unprepare(cmdq->clock);
 
-       if (cmdq->mbox.chans)
-               devm_kfree(&pdev->dev, cmdq->mbox.chans);
-
-       if (cmdq->thread)
-               devm_kfree(&pdev->dev, cmdq->thread);
-
-       devm_kfree(&pdev->dev, cmdq);
-
        return 0;
 }