---
name: "dma_alloc_from_coherent"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/dma_alloc_from_coherent"
---

# dma\_alloc\_from\_coherent(9)

try to allocate memory from the per-device coherent area

## NAME

dma\_alloc\_from\_coherent - try to allocate memory from the per-device coherent area

## SYNOPSIS

**int dma\_alloc\_from\_coherent(struct device \*** *dev***, ssize\_t** *size***, dma\_addr\_t \*** *dma\_handle***, void \*\*** *ret***);**

## ARGUMENTS

*dev*

device from which we allocate memory

*size*

size of requested memory area

*dma\_handle*

This will be filled with the correct dma handle

*ret*

This pointer will be filled with the virtual address to allocated area.

## DESCRIPTION

This function should be only called from per-arch **dma\_alloc\_coherent** to support allocation from per-device coherent memory pools.

Returns 0 if dma\_alloc\_coherent should continue with allocating from generic memory areas, or !0 if dma\_alloc\_coherent should return *ret*.

## COPYRIGHT
