mailbox: qcom-apcs: Use device-managed registration API
authorThierry Reding <treding@nvidia.com>
Thu, 20 Dec 2018 17:19:59 +0000 (18:19 +0100)
committerJassi Brar <jaswinder.singh@linaro.org>
Fri, 21 Dec 2018 22:49:25 +0000 (16:49 -0600)
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/qcom-apcs-ipc-mailbox.c

index aed23ac..3cf2937 100644 (file)
@@ -91,7 +91,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)
        apcs->mbox.chans = apcs->mbox_chans;
        apcs->mbox.num_chans = ARRAY_SIZE(apcs->mbox_chans);
 
-       ret = mbox_controller_register(&apcs->mbox);
+       ret = devm_mbox_controller_register(&pdev->dev, &apcs->mbox);
        if (ret) {
                dev_err(&pdev->dev, "failed to register APCS IPC controller\n");
                return ret;
@@ -115,7 +115,6 @@ static int qcom_apcs_ipc_remove(struct platform_device *pdev)
        struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev);
        struct platform_device *clk = apcs->clk;
 
-       mbox_controller_unregister(&apcs->mbox);
        platform_device_unregister(clk);
 
        return 0;