Skip to contentSkip to conversation

xtensa: Provide dummy dma_alloc_attrs() and dma_free_attrs()

PATCH In review Guenter Roeck 2 participants 2 messages Apr 21, 2015 – Apr 22, 2015 Tensilica Xtensa port (xtensa)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xtensa: Provide dummy dma_alloc_attrs() and dma_free_attrs()

xtensa:allmodconfig fails to build with the following errors.

drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:
In function ‘gk20a_instobj_dtor_dma’:
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:154:2: error:
implicit declaration of function ‘dma_free_attrs’
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:
In function ‘gk20a_instobj_ctor_dma’:
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:218:2: error:
implicit declaration of function ‘dma_alloc_attrs’

Xtensa does not provide those functions at this time. Provide dummy implementations to avoid build errors.

---
 arch/xtensa/include/asm/dma-mapping.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/xtensa/include/asm/dma-mapping.h +13 -0
index 172a02a6ad14..ba78ccf651e7 100644
@@ -185,4 +185,17 @@ static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
 	return -EINVAL;
 }
 
+static inline void *dma_alloc_attrs(struct device *dev, size_t size,
+				    dma_addr_t *dma_handle, gfp_t flag,
+				    struct dma_attrs *attrs)
+{
+	return NULL;
+}
+
+static inline void dma_free_attrs(struct device *dev, size_t size,
+				  void *vaddr, dma_addr_t dma_handle,
+				  struct dma_attrs *attrs)
+{
+}
+
 #endif	/* _XTENSA_DMA_MAPPING_H */
Signature · 1 line
2.1.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Guenter Roeck

xtensa:allmodconfig fails to build with the following errors.

drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:
In function ‘gk20a_instobj_dtor_dma’:
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:154:2: error:
implicit declaration of function ‘dma_free_attrs’
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:
In function ‘gk20a_instobj_ctor_dma’:
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:218:2: error:
implicit declaration of function ‘dma_alloc_attrs’

Quoted 4 lines

Xtensa does not provide those functions at this time. Provide dummy implementations to avoid build errors.

Signature · 2 lines
Thanks.
-- Max