diff options
author | Martyn Welch <martyn.welch@gefanuc.com> | 2010-02-18 15:12:58 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 16:43:00 -0800 |
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 8d8f9cb2974d..79c501dac5f9 100644 --- a/drivers/staging/vme/vme.c +++ b/drivers/staging/vme/vme.c @@ -643,7 +643,7 @@ EXPORT_SYMBOL(vme_master_free); * Request a DMA controller with specific attributes, return some unique * identifier. */ -struct vme_resource *vme_dma_request(struct device *dev) +struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route) { struct vme_bridge *bridge; struct list_head *dma_pos = NULL; @@ -670,9 +670,11 @@ struct vme_resource *vme_dma_request(struct device *dev) continue; } - /* Find an unlocked controller */ + /* Find an unlocked and compatible controller */ mutex_lock(&(dma_ctrlr->mtx)); - if (dma_ctrlr->locked == 0) { + if (((dma_ctrlr->route_attr & route) == route) && + (dma_ctrlr->locked == 0)) { + dma_ctrlr->locked = 1; mutex_unlock(&(dma_ctrlr->mtx)); allocated_ctrlr = dma_ctrlr; |