- struct list_head *pos, *tmp;
- unsigned int total = 0;
-
- /*
- * Look for each DMAC's range to determine who the owner of
- * the channel is.
- */
- list_for_each_safe(pos, tmp, ®istered_dmac_list) {
- struct dma_info *info = list_entry(pos, struct dma_info, list);
-
- total += info->nr_channels;
- if (chan > total)
- continue;
-
- return info;
- }
-
- return NULL;
-}
-
-struct dma_channel *get_dma_channel(unsigned int chan)
-{
- struct dma_info *info = get_dma_info(chan);
-
- if (!info)
- return ERR_PTR(-EINVAL);
-
- return info->channels + chan;