/* Allocate a new buffer and add it to the list of free buffers for this context. Must be called with ohci->lock held.  */
static int context_add_buffer(struct context *ctx)
/* Allocate a new buffer and add it to the list of free buffers for this context. Must be called with ohci->lock held.  */
static int context_add_buffer(struct context *ctx)
{
	struct descriptor_buffer *desc;
	dma_addr_t uninitialized_var(bus_addr);
	int offset;
	if (ctx->total_allocation >= 16*1024*1024)
		return -ENOMEM;
	desc = dma_alloc_coherent(ctx->ohci->card.device, PAGE_SIZE,
			&bus_addr, GFP_ATOMIC);
	if (!desc)
		return -ENOMEM;
	offset = (void *)&desc->buffer - (void *)desc;
	desc->buffer_size = PAGE_SIZE - offset;
	desc->buffer_bus = bus_addr + offset;
	desc->used = 0;
	list_add_tail(&desc->list, &ctx->buffer_list);
	ctx->total_allocation += PAGE_SIZE;
	return 0;
}