Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281113
b: refs/heads/master
c: 408f6bc
h: refs/heads/master
i:
  281111: 2bd85ac
v: v3
  • Loading branch information
Ravishankar karkala Mallikarjunayya authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent 992f5e5 commit 2e18de2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c62a0ef42c119f6c36d6f228839e0f3aafba0dca
refs/heads/master: 408f6bcd2acfe03c1f86b1fd9f77e010447b0080
16 changes: 4 additions & 12 deletions trunk/drivers/staging/comedi/drivers/pcl818.c
Original file line number Diff line number Diff line change
Expand Up @@ -1841,34 +1841,26 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (dma < 1)
goto no_dma; /* DMA disabled */
if (((1 << dma) & this_board->DMAbits) == 0) {
printk(", DMA is out of allowed range, FAIL!\n");
printk(KERN_ERR "DMA is out of allowed range, FAIL!\n");
return -EINVAL; /* Bad DMA */
}
ret = request_dma(dma, "pcl818");
if (ret) {
printk(", unable to allocate DMA %u, FAIL!\n", dma);
if (ret)
return -EBUSY; /* DMA isn't free */
}
devpriv->dma = dma;
printk(", dma=%u", dma);
pages = 2; /* we need 16KB */
devpriv->dmabuf[0] = __get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[0]) {
printk(", unable to allocate DMA buffer, FAIL!\n");
if (!devpriv->dmabuf[0])
/* maybe experiment with try_to_free_pages() will help .... */
return -EBUSY; /* no buffer :-( */
}
devpriv->dmapages[0] = pages;
devpriv->hwdmaptr[0] = virt_to_bus((void *)devpriv->dmabuf[0]);
devpriv->hwdmasize[0] = (1 << pages) * PAGE_SIZE;
/* printk("%d %d %ld, ",devpriv->dmapages[0],devpriv->hwdmasize[0],PAGE_SIZE); */
if (devpriv->dma_rtc == 0) { /* we must do duble buff :-( */
devpriv->dmabuf[1] = __get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[1]) {
printk
(", unable to allocate DMA buffer, FAIL!\n");
if (!devpriv->dmabuf[1])
return -EBUSY;
}
devpriv->dmapages[1] = pages;
devpriv->hwdmaptr[1] =
virt_to_bus((void *)devpriv->dmabuf[1]);
Expand Down

0 comments on commit 2e18de2

Please sign in to comment.