diff options
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r-- | drivers/dma/dmaengine.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 58cbf9fd5a46..03ac4b96117c 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -61,7 +61,7 @@ static long dmaengine_ref_count; | |||
61 | /* --- sysfs implementation --- */ | 61 | /* --- sysfs implementation --- */ |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * dev_to_dma_chan - convert a device pointer to the its sysfs container object | 64 | * dev_to_dma_chan - convert a device pointer to its sysfs container object |
65 | * @dev - device node | 65 | * @dev - device node |
66 | * | 66 | * |
67 | * Must be called under dma_list_mutex | 67 | * Must be called under dma_list_mutex |
@@ -629,11 +629,13 @@ EXPORT_SYMBOL_GPL(dma_get_any_slave_channel); | |||
629 | * @mask: capabilities that the channel must satisfy | 629 | * @mask: capabilities that the channel must satisfy |
630 | * @fn: optional callback to disposition available channels | 630 | * @fn: optional callback to disposition available channels |
631 | * @fn_param: opaque parameter to pass to dma_filter_fn | 631 | * @fn_param: opaque parameter to pass to dma_filter_fn |
632 | * @np: device node to look for DMA channels | ||
632 | * | 633 | * |
633 | * Returns pointer to appropriate DMA channel on success or NULL. | 634 | * Returns pointer to appropriate DMA channel on success or NULL. |
634 | */ | 635 | */ |
635 | struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, | 636 | struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, |
636 | dma_filter_fn fn, void *fn_param) | 637 | dma_filter_fn fn, void *fn_param, |
638 | struct device_node *np) | ||
637 | { | 639 | { |
638 | struct dma_device *device, *_d; | 640 | struct dma_device *device, *_d; |
639 | struct dma_chan *chan = NULL; | 641 | struct dma_chan *chan = NULL; |
@@ -641,6 +643,10 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, | |||
641 | /* Find a channel */ | 643 | /* Find a channel */ |
642 | mutex_lock(&dma_list_mutex); | 644 | mutex_lock(&dma_list_mutex); |
643 | list_for_each_entry_safe(device, _d, &dma_device_list, global_node) { | 645 | list_for_each_entry_safe(device, _d, &dma_device_list, global_node) { |
646 | /* Finds a DMA controller with matching device node */ | ||
647 | if (np && device->dev->of_node && np != device->dev->of_node) | ||
648 | continue; | ||
649 | |||
644 | chan = find_candidate(device, mask, fn, fn_param); | 650 | chan = find_candidate(device, mask, fn, fn_param); |
645 | if (!IS_ERR(chan)) | 651 | if (!IS_ERR(chan)) |
646 | break; | 652 | break; |
@@ -699,7 +705,7 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name) | |||
699 | chan = acpi_dma_request_slave_chan_by_name(dev, name); | 705 | chan = acpi_dma_request_slave_chan_by_name(dev, name); |
700 | 706 | ||
701 | if (chan) { | 707 | if (chan) { |
702 | /* Valid channel found or requester need to be deferred */ | 708 | /* Valid channel found or requester needs to be deferred */ |
703 | if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) | 709 | if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) |
704 | return chan; | 710 | return chan; |
705 | } | 711 | } |
@@ -757,7 +763,7 @@ struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask) | |||
757 | if (!mask) | 763 | if (!mask) |
758 | return ERR_PTR(-ENODEV); | 764 | return ERR_PTR(-ENODEV); |
759 | 765 | ||
760 | chan = __dma_request_channel(mask, NULL, NULL); | 766 | chan = __dma_request_channel(mask, NULL, NULL, NULL); |
761 | if (!chan) { | 767 | if (!chan) { |
762 | mutex_lock(&dma_list_mutex); | 768 | mutex_lock(&dma_list_mutex); |
763 | if (list_empty(&dma_device_list)) | 769 | if (list_empty(&dma_device_list)) |