Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-mapping: remove dma_alloc_noncoherent and dma_free_noncoherent

No users left, everyone switched to the _attrs versions.

Signed-off-by: Christoph Hellwig <hch@lst.de>

+20 -32
+16 -14
Documentation/DMA-API.txt
··· 515 515 :: 516 516 517 517 void * 518 - dma_alloc_noncoherent(struct device *dev, size_t size, 519 - dma_addr_t *dma_handle, gfp_t flag) 518 + dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle, 519 + gfp_t flag, unsigned long attrs) 520 520 521 - Identical to dma_alloc_coherent() except that the platform will 522 - choose to return either consistent or non-consistent memory as it sees 523 - fit. By using this API, you are guaranteeing to the platform that you 524 - have all the correct and necessary sync points for this memory in the 525 - driver should it choose to return non-consistent memory. 521 + Identical to dma_alloc_coherent() except that when the 522 + DMA_ATTR_NON_CONSISTENT flags is passed in the attrs argument, the 523 + platform will choose to return either consistent or non-consistent memory 524 + as it sees fit. By using this API, you are guaranteeing to the platform 525 + that you have all the correct and necessary sync points for this memory 526 + in the driver should it choose to return non-consistent memory. 526 527 527 528 Note: where the platform can return consistent memory, it will 528 529 guarantee that the sync points become nops. ··· 536 535 :: 537 536 538 537 void 539 - dma_free_noncoherent(struct device *dev, size_t size, void *cpu_addr, 540 - dma_addr_t dma_handle) 538 + dma_free_attrs(struct device *dev, size_t size, void *cpu_addr, 539 + dma_addr_t dma_handle, unsigned long attrs) 541 540 542 - Free memory allocated by the nonconsistent API. All parameters must 543 - be identical to those passed in (and returned by 544 - dma_alloc_noncoherent()). 541 + Free memory allocated by the dma_alloc_attrs(). All parameters common 542 + parameters must identical to those otherwise passed to dma_fre_coherent, 543 + and the attrs argument must be identical to the attrs passed to 544 + dma_alloc_attrs(). 545 545 546 546 :: 547 547 ··· 566 564 dma_cache_sync(struct device *dev, void *vaddr, size_t size, 567 565 enum dma_data_direction direction) 568 566 569 - Do a partial sync of memory that was allocated by 570 - dma_alloc_noncoherent(), starting at virtual address vaddr and 567 + Do a partial sync of memory that was allocated by dma_alloc_attrs() with 568 + the DMA_ATTR_NON_CONSISTENT flag starting at virtual address vaddr and 571 569 continuing on for size. Again, you *must* observe the cache line 572 570 boundaries when doing this. 573 571
+1 -1
arch/metag/include/asm/dma-mapping.h
··· 9 9 } 10 10 11 11 /* 12 - * dma_alloc_noncoherent() returns non-cacheable memory, so there's no need to 12 + * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to 13 13 * do any flushing here. 14 14 */ 15 15 static inline void
+1 -1
arch/nios2/include/asm/dma-mapping.h
··· 18 18 } 19 19 20 20 /* 21 - * dma_alloc_noncoherent() returns non-cacheable memory, so there's no need to 21 + * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to 22 22 * do any flushing here. 23 23 */ 24 24 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
+2 -2
arch/tile/include/asm/dma-mapping.h
··· 68 68 int dma_set_mask(struct device *dev, u64 mask); 69 69 70 70 /* 71 - * dma_alloc_noncoherent() is #defined to return coherent memory, 72 - * so there's no need to do any flushing here. 71 + * dma_alloc_attrs() always returns non-cacheable memory, so there's no need to 72 + * do any flushing here. 73 73 */ 74 74 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 75 75 enum dma_data_direction direction)
-14
include/linux/dma-mapping.h
··· 549 549 return dma_free_attrs(dev, size, cpu_addr, dma_handle, 0); 550 550 } 551 551 552 - static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, 553 - dma_addr_t *dma_handle, gfp_t gfp) 554 - { 555 - return dma_alloc_attrs(dev, size, dma_handle, gfp, 556 - DMA_ATTR_NON_CONSISTENT); 557 - } 558 - 559 - static inline void dma_free_noncoherent(struct device *dev, size_t size, 560 - void *cpu_addr, dma_addr_t dma_handle) 561 - { 562 - dma_free_attrs(dev, size, cpu_addr, dma_handle, 563 - DMA_ATTR_NON_CONSISTENT); 564 - } 565 - 566 552 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 567 553 { 568 554 const struct dma_map_ops *ops = get_dma_ops(dev);