]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
dma-mapping: remove dmam_{declare,release}_coherent_memory
authorChristoph Hellwig <hch@lst.de>
Wed, 26 Dec 2018 06:51:44 +0000 (07:51 +0100)
committerChristoph Hellwig <hch@lst.de>
Fri, 4 Jan 2019 08:03:17 +0000 (09:03 +0100)
These functions have never been used.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Documentation/driver-model/devres.txt
include/linux/dma-mapping.h
kernel/dma/mapping.c

index 841c99529d2717c7b08149bab847d893af9b8291..b277cafce71eb25effa455c90f3c24d14430856d 100644 (file)
@@ -250,7 +250,6 @@ DMA
   dmaenginem_async_device_register()
   dmam_alloc_coherent()
   dmam_alloc_attrs()
-  dmam_declare_coherent_memory()
   dmam_free_coherent()
   dmam_pool_create()
   dmam_pool_destroy()
index fa2ebe8ad4d02c5db017b2b557d5cd5a77ce503f..937c2a949fca7c29da17ed716cfdc766dcb05201 100644 (file)
@@ -691,25 +691,6 @@ static inline void dmam_free_coherent(struct device *dev, size_t size,
                                      void *vaddr, dma_addr_t dma_handle) { }
 #endif /* !CONFIG_HAS_DMA */
 
-#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
-extern int dmam_declare_coherent_memory(struct device *dev,
-                                       phys_addr_t phys_addr,
-                                       dma_addr_t device_addr, size_t size,
-                                       int flags);
-extern void dmam_release_declared_memory(struct device *dev);
-#else /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
-static inline int dmam_declare_coherent_memory(struct device *dev,
-                               phys_addr_t phys_addr, dma_addr_t device_addr,
-                               size_t size, gfp_t gfp)
-{
-       return 0;
-}
-
-static inline void dmam_release_declared_memory(struct device *dev)
-{
-}
-#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
-
 static inline void *dmam_alloc_coherent(struct device *dev, size_t size,
                dma_addr_t *dma_handle, gfp_t gfp)
 {
index f00544cda4e9d50eba6a6e8312884bea446496d7..a11006b6d8e87d5f64db77e777da08355a32ad8d 100644 (file)
@@ -105,61 +105,6 @@ void *dmam_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
 }
 EXPORT_SYMBOL(dmam_alloc_attrs);
 
-#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
-
-static void dmam_coherent_decl_release(struct device *dev, void *res)
-{
-       dma_release_declared_memory(dev);
-}
-
-/**
- * dmam_declare_coherent_memory - Managed dma_declare_coherent_memory()
- * @dev: Device to declare coherent memory for
- * @phys_addr: Physical address of coherent memory to be declared
- * @device_addr: Device address of coherent memory to be declared
- * @size: Size of coherent memory to be declared
- * @flags: Flags
- *
- * Managed dma_declare_coherent_memory().
- *
- * RETURNS:
- * 0 on success, -errno on failure.
- */
-int dmam_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
-                                dma_addr_t device_addr, size_t size, int flags)
-{
-       void *res;
-       int rc;
-
-       res = devres_alloc(dmam_coherent_decl_release, 0, GFP_KERNEL);
-       if (!res)
-               return -ENOMEM;
-
-       rc = dma_declare_coherent_memory(dev, phys_addr, device_addr, size,
-                                        flags);
-       if (!rc)
-               devres_add(dev, res);
-       else
-               devres_free(res);
-
-       return rc;
-}
-EXPORT_SYMBOL(dmam_declare_coherent_memory);
-
-/**
- * dmam_release_declared_memory - Managed dma_release_declared_memory().
- * @dev: Device to release declared coherent memory for
- *
- * Managed dmam_release_declared_memory().
- */
-void dmam_release_declared_memory(struct device *dev)
-{
-       WARN_ON(devres_destroy(dev, dmam_coherent_decl_release, NULL, NULL));
-}
-EXPORT_SYMBOL(dmam_release_declared_memory);
-
-#endif
-
 /*
  * Create scatter-list for the already allocated DMA buffer.
  */