typethe DMA buffer type
devicethe device pointer
sizethe buffer size to allocate
dmabbuffer allocation record to store the allocated data
Calls the memory-allocator function for the corresponding buffer type. When no space is left, this function reduces the size and tries to allocate again. The size actually allocated is stored in res_size argument.
Returns zero if the buffer with the given size is allocated successfuly, other a negative value at error.