From: Thierry Reding Date: Thu, 20 Dec 2018 17:20:00 +0000 (+0100) Subject: mailbox: rockchip: Use device-managed registration API X-Git-Tag: v5.0-rc1~56^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08f2f88a3bbf3cdfdf3b890159d45519e2d5bbeb;p=thirdparty%2Flinux.git mailbox: rockchip: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Reviewed-by: Caesar Wang Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar --- diff --git a/drivers/mailbox/rockchip-mailbox.c b/drivers/mailbox/rockchip-mailbox.c index d702a204f5c10..f24a77b1a0ff6 100644 --- a/drivers/mailbox/rockchip-mailbox.c +++ b/drivers/mailbox/rockchip-mailbox.c @@ -247,28 +247,15 @@ static int rockchip_mbox_probe(struct platform_device *pdev) mb->chans[i].msg = NULL; } - ret = mbox_controller_register(&mb->mbox); + ret = devm_mbox_controller_register(&pdev->dev, &mb->mbox); if (ret < 0) dev_err(&pdev->dev, "Failed to register mailbox: %d\n", ret); return ret; } -static int rockchip_mbox_remove(struct platform_device *pdev) -{ - struct rockchip_mbox *mb = platform_get_drvdata(pdev); - - if (!mb) - return -EINVAL; - - mbox_controller_unregister(&mb->mbox); - - return 0; -} - static struct platform_driver rockchip_mbox_driver = { .probe = rockchip_mbox_probe, - .remove = rockchip_mbox_remove, .driver = { .name = "rockchip-mailbox", .of_match_table = of_match_ptr(rockchip_mbox_of_match),