Re: [PATCH] move dma_consistent_dma_mask to the generic device

From: James Bottomley
Date: Wed Feb 25 2004 - 21:59:57 EST


On Wed, 2004-02-25 at 20:06, Andrew Morton wrote:
> A bit more grepping is needed.
>
> sound/core/memalloc.c: In function `snd_pci_hack_alloc_consistent':
> sound/core/memalloc.c:103: structure has no member named `consistent_dma_mask'

Mea culpa, I don't have any boxes that define this hack, so I didn't see
it. This sound memalloc is horribly illegal under the API...I suppose
we're just lucky the Altix doesn't have a sound card ;-)

This incremental patch should fix it up (I compiled it on parisc by
including it in the hacked architectures).

James

===== sound/core/memalloc.c 1.16 vs edited =====
--- 1.16/sound/core/memalloc.c Mon Jan 19 04:37:35 2004
+++ edited/sound/core/memalloc.c Wed Feb 25 20:51:28 2004
@@ -100,13 +100,13 @@
if (hwdev == NULL)
return pci_alloc_consistent(hwdev, size, dma_handle);
dma_mask = hwdev->dma_mask;
- cdma_mask = hwdev->consistent_dma_mask;
+ cdma_mask = hwdev->dev.coherent_dma_mask;
mask = (unsigned long)dma_mask && (unsigned long)cdma_mask;
hwdev->dma_mask = 0xffffffff; /* do without masking */
- hwdev->consistent_dma_mask = 0xffffffff; /* do without masking */
+ hwdev->dev.coherent_dma_mask = 0xffffffff; /* do without masking */
ret = pci_alloc_consistent(hwdev, size, dma_handle);
hwdev->dma_mask = dma_mask; /* restore */
- hwdev->consistent_dma_mask = cdma_mask; /* restore */
+ hwdev->dev.coherent_dma_mask = cdma_mask; /* restore */
if (ret) {
/* obtained address is out of range? */
if (((unsigned long)*dma_handle + size - 1) & ~mask) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/