Re: [PATCH 1/2] powerpc: rename get_dma_direct_offset get_dma_offset
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2009-09-21 05:19:56
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2009-09-21 05:19:56
On Wed, 2009-09-02 at 17:23 -0500, Becky Bruce wrote:
#ifdef CONFIG_NOT_COHERENT_CACHE /*@@ -90,6 +89,14 @@ static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) dev->archdata.dma_ops = ops; } +static inline unsigned long get_dma_offset(struct device *dev) +{ + if (dev) + return (unsigned long)dev->archdata.dma_data; + + return PCI_DRAM_OFFSET; +}
My main objection here is that this makes it look "too" generic ... it only works for direct and swiotlb, not iommu. Maybe not a big deal but I think at least there should be a comment explaining what it is and when it can be used in the header. Cheers, Ben.