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

mailbox: sti: Use device-managed registration API

Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.

Acked-by: Lee Jones <lee.jones@linaro.org>
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
d0c196db 87f63f57

+1 -12
+1 -12
drivers/mailbox/mailbox-sti.c
··· 462 462 mbox->chans = chans; 463 463 mbox->num_chans = STI_MBOX_CHAN_MAX; 464 464 465 - ret = mbox_controller_register(mbox); 465 + ret = devm_mbox_controller_register(&pdev->dev, mbox); 466 466 if (ret) 467 467 return ret; 468 468 ··· 480 480 IRQF_ONESHOT, mdev->name, mdev); 481 481 if (ret) { 482 482 dev_err(&pdev->dev, "Can't claim IRQ %d\n", irq); 483 - mbox_controller_unregister(mbox); 484 483 return -EINVAL; 485 484 } 486 485 ··· 488 489 return 0; 489 490 } 490 491 491 - static int sti_mbox_remove(struct platform_device *pdev) 492 - { 493 - struct sti_mbox_device *mdev = platform_get_drvdata(pdev); 494 - 495 - mbox_controller_unregister(mdev->mbox); 496 - 497 - return 0; 498 - } 499 - 500 492 static struct platform_driver sti_mbox_driver = { 501 493 .probe = sti_mbox_probe, 502 - .remove = sti_mbox_remove, 503 494 .driver = { 504 495 .name = "sti-mailbox", 505 496 .of_match_table = sti_mailbox_match,