aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/mpc512x_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/mpc512x_dma.c')
-rw-r--r--drivers/dma/mpc512x_dma.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c
index bbbd58566625..14a8c0f1698e 100644
--- a/drivers/dma/mpc512x_dma.c
+++ b/drivers/dma/mpc512x_dma.c
@@ -541,8 +541,8 @@ static void mpc_dma_issue_pending(struct dma_chan *chan)
541 541
542/* Check request completion status */ 542/* Check request completion status */
543static enum dma_status 543static enum dma_status
544mpc_dma_is_tx_complete(struct dma_chan *chan, dma_cookie_t cookie, 544mpc_dma_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
545 dma_cookie_t *done, dma_cookie_t *used) 545 struct dma_tx_state *txstate)
546{ 546{
547 struct mpc_dma_chan *mchan = dma_chan_to_mpc_dma_chan(chan); 547 struct mpc_dma_chan *mchan = dma_chan_to_mpc_dma_chan(chan);
548 unsigned long flags; 548 unsigned long flags;
@@ -554,12 +554,7 @@ mpc_dma_is_tx_complete(struct dma_chan *chan, dma_cookie_t cookie,
554 last_complete = mchan->completed_cookie; 554 last_complete = mchan->completed_cookie;
555 spin_unlock_irqrestore(&mchan->lock, flags); 555 spin_unlock_irqrestore(&mchan->lock, flags);
556 556
557 if (done) 557 dma_set_tx_state(txstate, last_complete, last_used, 0);
558 *done = last_complete;
559
560 if (used)
561 *used = last_used;
562
563 return dma_async_is_complete(cookie, last_complete, last_used); 558 return dma_async_is_complete(cookie, last_complete, last_used);
564} 559}
565 560
@@ -635,7 +630,7 @@ mpc_dma_prep_memcpy(struct dma_chan *chan, dma_addr_t dst, dma_addr_t src,
635static int __devinit mpc_dma_probe(struct of_device *op, 630static int __devinit mpc_dma_probe(struct of_device *op,
636 const struct of_device_id *match) 631 const struct of_device_id *match)
637{ 632{
638 struct device_node *dn = op->node; 633 struct device_node *dn = op->dev.of_node;
639 struct device *dev = &op->dev; 634 struct device *dev = &op->dev;
640 struct dma_device *dma; 635 struct dma_device *dma;
641 struct mpc_dma *mdma; 636 struct mpc_dma *mdma;
@@ -663,7 +658,7 @@ static int __devinit mpc_dma_probe(struct of_device *op,
663 } 658 }
664 659
665 regs_start = res.start; 660 regs_start = res.start;
666 regs_size = res.end - res.start + 1; 661 regs_size = resource_size(&res);
667 662
668 if (!devm_request_mem_region(dev, regs_start, regs_size, DRV_NAME)) { 663 if (!devm_request_mem_region(dev, regs_start, regs_size, DRV_NAME)) {
669 dev_err(dev, "Error requesting memory region!\n"); 664 dev_err(dev, "Error requesting memory region!\n");
@@ -694,7 +689,7 @@ static int __devinit mpc_dma_probe(struct of_device *op,
694 dma->device_alloc_chan_resources = mpc_dma_alloc_chan_resources; 689 dma->device_alloc_chan_resources = mpc_dma_alloc_chan_resources;
695 dma->device_free_chan_resources = mpc_dma_free_chan_resources; 690 dma->device_free_chan_resources = mpc_dma_free_chan_resources;
696 dma->device_issue_pending = mpc_dma_issue_pending; 691 dma->device_issue_pending = mpc_dma_issue_pending;
697 dma->device_is_tx_complete = mpc_dma_is_tx_complete; 692 dma->device_tx_status = mpc_dma_tx_status;
698 dma->device_prep_dma_memcpy = mpc_dma_prep_memcpy; 693 dma->device_prep_dma_memcpy = mpc_dma_prep_memcpy;
699 694
700 INIT_LIST_HEAD(&dma->channels); 695 INIT_LIST_HEAD(&dma->channels);
@@ -776,12 +771,12 @@ static struct of_device_id mpc_dma_match[] = {
776}; 771};
777 772
778static struct of_platform_driver mpc_dma_driver = { 773static struct of_platform_driver mpc_dma_driver = {
779 .match_table = mpc_dma_match,
780 .probe = mpc_dma_probe, 774 .probe = mpc_dma_probe,
781 .remove = __devexit_p(mpc_dma_remove), 775 .remove = __devexit_p(mpc_dma_remove),
782 .driver = { 776 .driver = {
783 .name = DRV_NAME, 777 .name = DRV_NAME,
784 .owner = THIS_MODULE, 778 .owner = THIS_MODULE,
779 .of_match_table = mpc_dma_match,
785 }, 780 },
786}; 781};
787 782