diff options
author | Greg Kroah-Hartman | 2013-05-27 03:54:33 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-05-27 03:54:33 +0200 |
commit | 829455bb0e994373519e3c58d403fc1148f44630 (patch) | |
tree | 7e4a250eb8208e2a7fa2787b03d2cf989a8ccc5a /drivers/staging/comedi/comedi_buf.c | |
parent | staging: ozwpan: Revert last changes (diff) | |
parent | Linux 3.10-rc3 (diff) | |
download | kernel-qcow2-linux-829455bb0e994373519e3c58d403fc1148f44630.tar.gz kernel-qcow2-linux-829455bb0e994373519e3c58d403fc1148f44630.tar.xz kernel-qcow2-linux-829455bb0e994373519e3c58d403fc1148f44630.zip |
Merge 3.10-rc3 into staging-next
We want the changes here, and we resolve the merge conflict that was
happening in the nvec_kbd.c file.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_buf.c')
-rw-r--r-- | drivers/staging/comedi/comedi_buf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index ce17c55afc77..b4c001b6f88f 100644 --- a/drivers/staging/comedi/comedi_buf.c +++ b/drivers/staging/comedi/comedi_buf.c @@ -47,10 +47,12 @@ static void __comedi_buf_free(struct comedi_device *dev, clear_bit(PG_reserved, &(virt_to_page(buf->virt_addr)->flags)); if (s->async_dma_dir != DMA_NONE) { +#ifdef CONFIG_HAS_DMA dma_free_coherent(dev->hw_dev, PAGE_SIZE, buf->virt_addr, buf->dma_addr); +#endif } else { free_page((unsigned long)buf->virt_addr); } @@ -70,6 +72,12 @@ static void __comedi_buf_alloc(struct comedi_device *dev, struct comedi_buf_page *buf; unsigned i; + if (!IS_ENABLED(CONFIG_HAS_DMA) && s->async_dma_dir != DMA_NONE) { + dev_err(dev->class_dev, + "dma buffer allocation not supported\n"); + return; + } + async->buf_page_list = vzalloc(sizeof(*buf) * n_pages); if (async->buf_page_list) pages = vmalloc(sizeof(struct page *) * n_pages); @@ -80,11 +88,15 @@ static void __comedi_buf_alloc(struct comedi_device *dev, for (i = 0; i < n_pages; i++) { buf = &async->buf_page_list[i]; if (s->async_dma_dir != DMA_NONE) +#ifdef CONFIG_HAS_DMA buf->virt_addr = dma_alloc_coherent(dev->hw_dev, PAGE_SIZE, &buf->dma_addr, GFP_KERNEL | __GFP_COMP); +#else + break; +#endif else buf->virt_addr = (void *)get_zeroed_page(GFP_KERNEL); if (!buf->virt_addr) |