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>
This commit is contained in:
committed by
Jassi Brar
parent
87f63f578b
commit
d0c196dbee
@@ -462,7 +462,7 @@ static int sti_mbox_probe(struct platform_device *pdev)
|
|||||||
mbox->chans = chans;
|
mbox->chans = chans;
|
||||||
mbox->num_chans = STI_MBOX_CHAN_MAX;
|
mbox->num_chans = STI_MBOX_CHAN_MAX;
|
||||||
|
|
||||||
ret = mbox_controller_register(mbox);
|
ret = devm_mbox_controller_register(&pdev->dev, mbox);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -480,7 +480,6 @@ static int sti_mbox_probe(struct platform_device *pdev)
|
|||||||
IRQF_ONESHOT, mdev->name, mdev);
|
IRQF_ONESHOT, mdev->name, mdev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "Can't claim IRQ %d\n", irq);
|
dev_err(&pdev->dev, "Can't claim IRQ %d\n", irq);
|
||||||
mbox_controller_unregister(mbox);
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -489,18 +488,8 @@ static int sti_mbox_probe(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sti_mbox_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct sti_mbox_device *mdev = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
mbox_controller_unregister(mdev->mbox);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct platform_driver sti_mbox_driver = {
|
static struct platform_driver sti_mbox_driver = {
|
||||||
.probe = sti_mbox_probe,
|
.probe = sti_mbox_probe,
|
||||||
.remove = sti_mbox_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "sti-mailbox",
|
.name = "sti-mailbox",
|
||||||
.of_match_table = sti_mailbox_match,
|
.of_match_table = sti_mailbox_match,
|
||||||
|
|||||||
Reference in New Issue
Block a user