Re: [PATCH 08/13] dmatest: convert to dma_request_channel
From: Andrew Morton
Date: Sat Nov 15 2008 - 01:17:25 EST
On Fri, 14 Nov 2008 14:34:58 -0700 Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
> static int __init dmatest_init(void)
> {
> - dma_cap_set(DMA_MEMCPY, dmatest_client.cap_mask);
> - dma_async_client_register(&dmatest_client);
> - dma_async_client_chan_request(&dmatest_client);
> + dma_cap_mask_t mask;
> + struct dma_chan *chan;
> +
> + dma_cap_zero(mask);
> + dma_cap_set(DMA_MEMCPY, mask);
> + for (;;) {
> + chan = dma_request_channel(mask, filter, NULL);
> + if (chan) {
> + if (dmatest_add_channel(chan) == 0)
> + continue;
hrm. I trust this loop can't lock up the box.
> + else
> + dma_release_channel(chan);
> + } else
> + break; /* no more channels available */
> + if (max_channels && nr_channels >= max_channels)
> + break; /* we have all we need */
> + }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/