]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
firmware: qcom: scm: Use devm_reset_controller_register()
authorWei Yongjun <weiyongjun1@huawei.com>
Sun, 28 Aug 2016 16:29:10 +0000 (16:29 +0000)
committerAndy Gross <andy.gross@linaro.org>
Sun, 13 Nov 2016 05:24:51 +0000 (23:24 -0600)
Use devm_reset_controller_register() for the reset controller
registration and fixes the memory leak when unload the module.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
drivers/firmware/qcom_scm.c

index d95c70227c05ee8d26bd60d2ab25b1a7be27b549..9bf66aefdbd08b286535c7926c1ffb6bcab8b57f 100644 (file)
@@ -356,7 +356,9 @@ static int qcom_scm_probe(struct platform_device *pdev)
        scm->reset.ops = &qcom_scm_pas_reset_ops;
        scm->reset.nr_resets = 1;
        scm->reset.of_node = pdev->dev.of_node;
-       reset_controller_register(&scm->reset);
+       ret = devm_reset_controller_register(&pdev->dev, &scm->reset);
+       if (ret)
+               return ret;
 
        /* vote for max clk rate for highest performance */
        ret = clk_set_rate(scm->core_clk, INT_MAX);