mailbox: omap: Use device-managed registration API
authorThierry Reding <treding@nvidia.com>
Thu, 20 Dec 2018 17:19:57 +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.

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

index db66e952a87153e77df761a0ef04e53e04880330..ca50177a33f29ecd7c4ce4151a5c3b606417256f 100644 (file)
@@ -486,7 +486,7 @@ static int omap_mbox_register(struct omap_mbox_device *mdev)
        list_add(&mdev->elem, &omap_mbox_devices);
        mutex_unlock(&omap_mbox_devices_lock);
 
-       ret = mbox_controller_register(&mdev->controller);
+       ret = devm_mbox_controller_register(mdev->dev, &mdev->controller);
 
 err_out:
        if (ret) {
@@ -508,8 +508,6 @@ static int omap_mbox_unregister(struct omap_mbox_device *mdev)
        list_del(&mdev->elem);
        mutex_unlock(&omap_mbox_devices_lock);
 
-       mbox_controller_unregister(&mdev->controller);
-
        mboxes = mdev->mboxes;
        for (i = 0; mboxes[i]; i++)
                device_unregister(mboxes[i]->dev);