diff options
author | Martyn Welch <martyn.welch@gefanuc.com> | 2010-02-18 10:12:58 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 19:43:00 -0500 |
commit | 4f723df45d3952c485ee0125fb6797ad615901c3 (patch) | |
tree | 3db9d8a00c01c0ffa4d3d66630abf4e72e4771ed /drivers/staging/vme/vme.c | |
parent | 66bd8db52ab48e7189e02d4bf1f23109cc1ede70 (diff) |
Staging: vme: Attribute Testing For Dma Request
Check the directions in which the DMA controller is expected to operate
before giving control of a resource.
Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vme/vme.c')
-rw-r--r-- | drivers/staging/vme/vme.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c index 8d8f9cb2974..79c501dac5f 100644 --- a/drivers/staging/vme/vme.c +++ b/drivers/staging/vme/vme.c | |||
@@ -643,7 +643,7 @@ EXPORT_SYMBOL(vme_master_free); | |||
643 | * Request a DMA controller with specific attributes, return some unique | 643 | * Request a DMA controller with specific attributes, return some unique |
644 | * identifier. | 644 | * identifier. |
645 | */ | 645 | */ |
646 | struct vme_resource *vme_dma_request(struct device *dev) | 646 | struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route) |
647 | { | 647 | { |
648 | struct vme_bridge *bridge; | 648 | struct vme_bridge *bridge; |
649 | struct list_head *dma_pos = NULL; | 649 | struct list_head *dma_pos = NULL; |
@@ -670,9 +670,11 @@ struct vme_resource *vme_dma_request(struct device *dev) | |||
670 | continue; | 670 | continue; |
671 | } | 671 | } |
672 | 672 | ||
673 | /* Find an unlocked controller */ | 673 | /* Find an unlocked and compatible controller */ |
674 | mutex_lock(&(dma_ctrlr->mtx)); | 674 | mutex_lock(&(dma_ctrlr->mtx)); |
675 | if (dma_ctrlr->locked == 0) { | 675 | if (((dma_ctrlr->route_attr & route) == route) && |
676 | (dma_ctrlr->locked == 0)) { | ||
677 | |||
676 | dma_ctrlr->locked = 1; | 678 | dma_ctrlr->locked = 1; |
677 | mutex_unlock(&(dma_ctrlr->mtx)); | 679 | mutex_unlock(&(dma_ctrlr->mtx)); |
678 | allocated_ctrlr = dma_ctrlr; | 680 | allocated_ctrlr = dma_ctrlr; |