Commit ad3e7f96 authored by Thierry Reding's avatar Thierry Reding Committed by Jassi Brar

mailbox: hi6220: Use device-managed registration API

Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent e73cb83c
...@@ -349,7 +349,7 @@ static int hi6220_mbox_probe(struct platform_device *pdev) ...@@ -349,7 +349,7 @@ static int hi6220_mbox_probe(struct platform_device *pdev)
mbox->controller.txpoll_period = 5; mbox->controller.txpoll_period = 5;
} }
err = mbox_controller_register(&mbox->controller); err = devm_mbox_controller_register(dev, &mbox->controller);
if (err) { if (err) {
dev_err(dev, "Failed to register mailbox %d\n", err); dev_err(dev, "Failed to register mailbox %d\n", err);
return err; return err;
...@@ -360,14 +360,6 @@ static int hi6220_mbox_probe(struct platform_device *pdev) ...@@ -360,14 +360,6 @@ static int hi6220_mbox_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int hi6220_mbox_remove(struct platform_device *pdev)
{
struct hi6220_mbox *mbox = platform_get_drvdata(pdev);
mbox_controller_unregister(&mbox->controller);
return 0;
}
static struct platform_driver hi6220_mbox_driver = { static struct platform_driver hi6220_mbox_driver = {
.driver = { .driver = {
.name = "hi6220-mbox", .name = "hi6220-mbox",
...@@ -375,7 +367,6 @@ static struct platform_driver hi6220_mbox_driver = { ...@@ -375,7 +367,6 @@ static struct platform_driver hi6220_mbox_driver = {
.of_match_table = hi6220_mbox_of_match, .of_match_table = hi6220_mbox_of_match,
}, },
.probe = hi6220_mbox_probe, .probe = hi6220_mbox_probe,
.remove = hi6220_mbox_remove,
}; };
static int __init hi6220_mbox_init(void) static int __init hi6220_mbox_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment