Re: [PATCH v2 17/19] mailbox: rockchip: Use device-managed registration API
From: Caesar Wang
Date: Mon Dec 17 2018 - 19:44:10 EST
On 2018/12/17 äå11:02, Thierry Reding wrote:
From: Thierry Reding <treding@xxxxxxxxxx>
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Reviewed-by: Caesar Wang <wxt@xxxxxxxxxxxxxx>
Thanks,
Caesar
Cc: Caesar Wang <wxt@xxxxxxxxxxxxxx>
Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
---
drivers/mailbox/rockchip-mailbox.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/drivers/mailbox/rockchip-mailbox.c b/drivers/mailbox/rockchip-mailbox.c
index d702a204f5c1..f24a77b1a0ff 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),
--
çæè | ççäåäé | èäåçå
Caesar Wang | Product R&D Dept.III | Software engineer
**************************************************
çåçèåçåèäæéåå
Fuzhou Rockchip Electronics Co.Ltd
ååïçåççååéçèèäåé89åèäåAå20åæ (çåæé)
Addr: No.20 Building, A District, Fuzhou Software Park.Gulou District,Fuzhou,Fujian,China(Fuzhou Headquarters)
Telï+86-0591-83991906-8221
Mobile: +86 15059456742
E-mail: wxt@xxxxxxxxxxxxxx
*************************************************
****************************************************************************
äåæçïæéäååéäåææåäæïäåéçæéäææçåæääãèéèçåæääïèåååã
äçææéæéäçääååãèèææéäïèäççäæäæåéæéäåææéäïåäååéäæåäæååååçåääã
çåçèåçåæéååæææéääæçèäæåèéæïçæääæçææèåçäæèäã
IMPORTANT NOTICE: This email is from Fuzhou Rockchip Electronics Co., Ltd .The contents of this
email and any attachments may contain information that is privileged, confidential and/or exempt from disclosure under applicable law and relevant NDA.
If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information is STRICTLY PROHIBITED.
Please immediately contact the sender as soon as possible and destroy the material in its entirety in any format. Thank you.