Commit 2298a6f0 authored by Thierry Reding's avatar Thierry Reding Committed by Jassi Brar

mailbox: ti-msgmgr: Use device-managed registration API

Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 368d7767
...@@ -817,26 +817,15 @@ static int ti_msgmgr_probe(struct platform_device *pdev) ...@@ -817,26 +817,15 @@ static int ti_msgmgr_probe(struct platform_device *pdev)
mbox->of_xlate = ti_msgmgr_of_xlate; mbox->of_xlate = ti_msgmgr_of_xlate;
platform_set_drvdata(pdev, inst); platform_set_drvdata(pdev, inst);
ret = mbox_controller_register(mbox); ret = devm_mbox_controller_register(dev, mbox);
if (ret) if (ret)
dev_err(dev, "Failed to register mbox_controller(%d)\n", ret); dev_err(dev, "Failed to register mbox_controller(%d)\n", ret);
return ret; return ret;
} }
static int ti_msgmgr_remove(struct platform_device *pdev)
{
struct ti_msgmgr_inst *inst;
inst = platform_get_drvdata(pdev);
mbox_controller_unregister(&inst->mbox);
return 0;
}
static struct platform_driver ti_msgmgr_driver = { static struct platform_driver ti_msgmgr_driver = {
.probe = ti_msgmgr_probe, .probe = ti_msgmgr_probe,
.remove = ti_msgmgr_remove,
.driver = { .driver = {
.name = "ti-msgmgr", .name = "ti-msgmgr",
.of_match_table = of_match_ptr(ti_msgmgr_of_match), .of_match_table = of_match_ptr(ti_msgmgr_of_match),
......
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