diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2010-02-02 23:10:39 +0100 | 
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2010-02-02 23:10:39 +0100 | 
| commit | e1a0bdd8022317e98650e70850de73eccfcde5ad (patch) | |
| tree | 462f63307118b95c8cbacee6954e4d09ee85b8d1 /lib/dma-debug.c | |
| parent | 8127f4e883666c9960cfa89cffd36313748f8bab (diff) | |
| parent | 1a45dcfe2525e9432cb4aba461d4994fc2befe42 (diff) | |
Merge branch 'master' into upstream
Conflicts:
	drivers/hid/hid-ids.h
Diffstat (limited to 'lib/dma-debug.c')
| -rw-r--r-- | lib/dma-debug.c | 17 | 
1 files changed, 10 insertions, 7 deletions
| diff --git a/lib/dma-debug.c b/lib/dma-debug.c index d9b08e0f7f5..ba8b67039d1 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -587,7 +587,7 @@ out_unlock:  	return count;  } -const struct file_operations filter_fops = { +static const struct file_operations filter_fops = {  	.read  = filter_read,  	.write = filter_write,  }; @@ -670,12 +670,13 @@ static int device_dma_allocations(struct device *dev)  	return count;  } -static int dma_debug_device_change(struct notifier_block *nb, -				    unsigned long action, void *data) +static int dma_debug_device_change(struct notifier_block *nb, unsigned long action, void *data)  {  	struct device *dev = data;  	int count; +	if (global_disable) +		return 0;  	switch (action) {  	case BUS_NOTIFY_UNBOUND_DRIVER: @@ -697,6 +698,9 @@ void dma_debug_add_bus(struct bus_type *bus)  {  	struct notifier_block *nb; +	if (global_disable) +		return; +  	nb = kzalloc(sizeof(struct notifier_block), GFP_KERNEL);  	if (nb == NULL) {  		pr_err("dma_debug_add_bus: out of memory\n"); @@ -909,6 +913,9 @@ static void check_sync(struct device *dev,  				ref->size);  	} +	if (entry->direction == DMA_BIDIRECTIONAL) +		goto out; +  	if (ref->direction != entry->direction) {  		err_printk(dev, entry, "DMA-API: device driver syncs "  				"DMA memory with different direction " @@ -919,9 +926,6 @@ static void check_sync(struct device *dev,  				dir2name[ref->direction]);  	} -	if (entry->direction == DMA_BIDIRECTIONAL) -		goto out; -  	if (to_cpu && !(entry->direction == DMA_FROM_DEVICE) &&  		      !(ref->direction == DMA_TO_DEVICE))  		err_printk(dev, entry, "DMA-API: device driver syncs " @@ -944,7 +948,6 @@ static void check_sync(struct device *dev,  out:  	put_hash_bucket(bucket, &flags); -  }  void debug_dma_map_page(struct device *dev, struct page *page, size_t offset, | 
