lkml.org 
[lkml]   [2008]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch v3] doc: DMA-mapping.txt has undeclared variables [Bug 10397]
On Mon, Apr 28, 2008 at 05:58:49AM -0700, Matti Linnanvuori wrote:
> From: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
>
> Consistently use pdev as the variable of type struct pci_dev *.
> Update DMA mapping documentation to use 'pdev' rather than 'dev' in
> example code that calls routines expecting 'struct pci_device *', since 'dev'
> might make readers think they're passing 'struct device *' parameters.
> Bug 10397.
>
> Signed-off-by: Matti Linnanvuori <mattilinnanvuori@yahoo.com>

Acked-by: Matthew Wilcox <willy@linux.intel.com>

> - cpu_addr = pci_alloc_consistent(dev, size, &dma_handle);
> + cpu_addr = pci_alloc_consistent(pdev, size, &dma_handle);
>
> -where dev is a struct pci_dev *. You should pass NULL for PCI like buses
> +where pdev is a struct pci_dev *. You should pass NULL for PCI like buses
> where devices don't have struct pci_dev (like ISA, EISA). This may be
> called in interrupt context.

The second sentence is misleading (but it's unrelated to this patch).
If you don't have a pdev, you should be using dma_alloc_coherent()
instead (see DMA-API.txt). Want to make another patch? ;-)

--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."


\
 
 \ /
  Last update: 2008-04-28 15:09    [W:0.041 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site