Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <wxt@rock-chips.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>

authored by

Thierry Reding and committed by
Jassi Brar
08f2f88a 83dd44a1

+1 -14
+1 -14
drivers/mailbox/rockchip-mailbox.c
··· 247 247 mb->chans[i].msg = NULL; 248 248 } 249 249 250 - ret = mbox_controller_register(&mb->mbox); 250 + ret = devm_mbox_controller_register(&pdev->dev, &mb->mbox); 251 251 if (ret < 0) 252 252 dev_err(&pdev->dev, "Failed to register mailbox: %d\n", ret); 253 253 254 254 return ret; 255 255 } 256 256 257 - static int rockchip_mbox_remove(struct platform_device *pdev) 258 - { 259 - struct rockchip_mbox *mb = platform_get_drvdata(pdev); 260 - 261 - if (!mb) 262 - return -EINVAL; 263 - 264 - mbox_controller_unregister(&mb->mbox); 265 - 266 - return 0; 267 - } 268 - 269 257 static struct platform_driver rockchip_mbox_driver = { 270 258 .probe = rockchip_mbox_probe, 271 - .remove = rockchip_mbox_remove, 272 259 .driver = { 273 260 .name = "rockchip-mailbox", 274 261 .of_match_table = of_match_ptr(rockchip_mbox_of_match),