Update of /cvsroot/alsa/alsa-kernel/core In directory usw-pr-cvs1:/tmp/cvs-serv10444
Modified Files: wrappers.c Log Message: - call pci_alloc_consistent() again if failed without dma mask. - added more comments. Index: wrappers.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/core/wrappers.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- wrappers.c 19 Sep 2002 09:59:38 -0000 1.7 +++ wrappers.c 23 Sep 2002 10:22:55 -0000 1.8 @@ -99,9 +99,17 @@ hwdev->dma_mask = 0xffffffff; /* do without masking */ ret = pci_alloc_consistent(hwdev, size, dma_handle); hwdev->dma_mask = dma_mask; /* restore */ - if (ret && (((unsigned long)*dma_handle + size - 1) & rmask)) { - pci_free_consistent(hwdev, size, ret, *dma_handle); - ret = pci_alloc_consistent(hwdev, size, dma_handle); + if (ret) { + /* obtained address is out of range? */ + if (((unsigned long)*dma_handle + size - 1) & rmask) { + /* reallocate with the proper mask */ + pci_free_consistent(hwdev, size, ret, *dma_handle); + ret = pci_alloc_consistent(hwdev, size, dma_handle); + } + } else { + /* wish to success now with the proper mask... */ + if (dma_mask != 0xffffffff) + ret = pci_alloc_consistent(hwdev, size, dma_handle); } return ret; } ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog