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

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

authored by

Thierry Reding and committed by
Jassi Brar
0b7f5fe8 d0c196db

+1 -10
+1 -10
drivers/mailbox/mailbox-xgene-slimpro.c
··· 224 224 ctx->mb_ctrl.ops = &slimpro_mbox_ops; 225 225 ctx->mb_ctrl.num_chans = i; 226 226 227 - rc = mbox_controller_register(&ctx->mb_ctrl); 227 + rc = devm_mbox_controller_register(&pdev->dev, &ctx->mb_ctrl); 228 228 if (rc) { 229 229 dev_err(&pdev->dev, 230 230 "APM X-Gene SLIMpro MailBox register failed:%d\n", rc); ··· 232 232 } 233 233 234 234 dev_info(&pdev->dev, "APM X-Gene SLIMpro MailBox registered\n"); 235 - return 0; 236 - } 237 - 238 - static int slimpro_mbox_remove(struct platform_device *pdev) 239 - { 240 - struct slimpro_mbox *smb = platform_get_drvdata(pdev); 241 - 242 - mbox_controller_unregister(&smb->mb_ctrl); 243 235 return 0; 244 236 } 245 237 ··· 251 259 252 260 static struct platform_driver slimpro_mbox_driver = { 253 261 .probe = slimpro_mbox_probe, 254 - .remove = slimpro_mbox_remove, 255 262 .driver = { 256 263 .name = "xgene-slimpro-mbox", 257 264 .of_match_table = of_match_ptr(slimpro_of_match),