Skip to content

Commit

Permalink
mailbox: hi3660: Use device-managed registration API
Browse files Browse the repository at this point in the history
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.

Tested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
  • Loading branch information
thierryreding authored and JassiBrar committed Dec 21, 2018
1 parent 6267ee6 commit e73cb83
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/mailbox/hi3660-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static int hi3660_mbox_probe(struct platform_device *pdev)
for (ch = 0; ch < MBOX_CHAN_MAX; ch++)
chan[ch].con_priv = (void *)ch;

err = mbox_controller_register(&mbox->controller);
err = devm_mbox_controller_register(dev, &mbox->controller);
if (err) {
dev_err(dev, "Failed to register mailbox %d\n", err);
return err;
Expand All @@ -276,17 +276,8 @@ static int hi3660_mbox_probe(struct platform_device *pdev)
return 0;
}

static int hi3660_mbox_remove(struct platform_device *pdev)
{
struct hi3660_mbox *mbox = platform_get_drvdata(pdev);

mbox_controller_unregister(&mbox->controller);
return 0;
}

static struct platform_driver hi3660_mbox_driver = {
.probe = hi3660_mbox_probe,
.remove = hi3660_mbox_remove,
.driver = {
.name = "hi3660-mbox",
.of_match_table = hi3660_mbox_of_match,
Expand Down

0 comments on commit e73cb83

Please sign in to comment.