2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 01:34:00 +08:00

mailbox: armada-37xx-rwtm: Use device-managed registration API

Use devm_mbox_controller_register to get rid of
redundant remove function.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
This commit is contained in:
Chuhong Yuan 2019-07-22 21:37:23 +08:00 committed by Jassi Brar
parent f74c2bb987
commit 2b983d124a

View File

@ -180,7 +180,7 @@ static int armada_37xx_mbox_probe(struct platform_device *pdev)
mbox->controller.ops = &a37xx_mbox_ops; mbox->controller.ops = &a37xx_mbox_ops;
mbox->controller.txdone_irq = true; mbox->controller.txdone_irq = true;
ret = mbox_controller_register(&mbox->controller); ret = devm_mbox_controller_register(mbox->dev, &mbox->controller);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Could not register mailbox controller\n"); dev_err(&pdev->dev, "Could not register mailbox controller\n");
return ret; return ret;
@ -190,17 +190,6 @@ static int armada_37xx_mbox_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int armada_37xx_mbox_remove(struct platform_device *pdev)
{
struct a37xx_mbox *mbox = platform_get_drvdata(pdev);
if (!mbox)
return -EINVAL;
mbox_controller_unregister(&mbox->controller);
return 0;
}
static const struct of_device_id armada_37xx_mbox_match[] = { static const struct of_device_id armada_37xx_mbox_match[] = {
{ .compatible = "marvell,armada-3700-rwtm-mailbox" }, { .compatible = "marvell,armada-3700-rwtm-mailbox" },
@ -211,7 +200,6 @@ MODULE_DEVICE_TABLE(of, armada_37xx_mbox_match);
static struct platform_driver armada_37xx_mbox_driver = { static struct platform_driver armada_37xx_mbox_driver = {
.probe = armada_37xx_mbox_probe, .probe = armada_37xx_mbox_probe,
.remove = armada_37xx_mbox_remove,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.of_match_table = armada_37xx_mbox_match, .of_match_table = armada_37xx_mbox_match,