Source
1464
1464
if (!mbc->chans)
1465
1465
return -ENOMEM;
1466
1466
1467
1467
mbc->txdone_irq = false;
1468
1468
mbc->txdone_poll = true;
1469
1469
mbc->txpoll_period = 1;
1470
1470
for (chan_index = 0; chan_index < mbc->num_chans; chan_index++)
1471
1471
mbc->chans[chan_index].con_priv = pdcs;
1472
1472
1473
1473
/* Register mailbox controller */
1474
-
err = mbox_controller_register(mbc);
1474
+
err = devm_mbox_controller_register(dev, mbc);
1475
1475
if (err) {
1476
1476
dev_crit(dev,
1477
1477
"Failed to register PDC mailbox controller. Error %d.",
1478
1478
err);
1479
1479
return err;
1480
1480
}
1481
1481
return 0;
1482
1482
}
1483
1483
1484
1484
/* Device tree API */
1634
1634
static int pdc_remove(struct platform_device *pdev)
1635
1635
{
1636
1636
struct pdc_state *pdcs = platform_get_drvdata(pdev);
1637
1637
1638
1638
pdc_free_debugfs();
1639
1639
1640
1640
tasklet_kill(&pdcs->rx_tasklet);
1641
1641
1642
1642
pdc_hw_disable(pdcs);
1643
1643
1644
-
mbox_controller_unregister(&pdcs->mbc);
1645
-
1646
1644
dma_pool_destroy(pdcs->rx_buf_pool);
1647
1645
dma_pool_destroy(pdcs->ring_pool);
1648
1646
return 0;
1649
1647
}
1650
1648
1651
1649
static struct platform_driver pdc_mbox_driver = {
1652
1650
.probe = pdc_probe,
1653
1651
.remove = pdc_remove,
1654
1652
.driver = {
1655
1653
.name = "brcm-iproc-pdc-mbox",