diff options
-rw-r--r-- | drivers/base/dmapool.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c index cd467c9f33b3..9406259754ad 100644 --- a/drivers/base/dmapool.c +++ b/drivers/base/dmapool.c | |||
@@ -37,7 +37,7 @@ struct dma_page { /* cacheable header for 'allocation' bytes */ | |||
37 | 37 | ||
38 | #define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000) | 38 | #define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000) |
39 | 39 | ||
40 | static DECLARE_MUTEX (pools_lock); | 40 | static DEFINE_MUTEX (pools_lock); |
41 | 41 | ||
42 | static ssize_t | 42 | static ssize_t |
43 | show_pools (struct device *dev, struct device_attribute *attr, char *buf) | 43 | show_pools (struct device *dev, struct device_attribute *attr, char *buf) |
@@ -55,7 +55,7 @@ show_pools (struct device *dev, struct device_attribute *attr, char *buf) | |||
55 | size -= temp; | 55 | size -= temp; |
56 | next += temp; | 56 | next += temp; |
57 | 57 | ||
58 | down (&pools_lock); | 58 | mutex_lock(&pools_lock); |
59 | list_for_each_entry(pool, &dev->dma_pools, pools) { | 59 | list_for_each_entry(pool, &dev->dma_pools, pools) { |
60 | unsigned pages = 0; | 60 | unsigned pages = 0; |
61 | unsigned blocks = 0; | 61 | unsigned blocks = 0; |
@@ -73,7 +73,7 @@ show_pools (struct device *dev, struct device_attribute *attr, char *buf) | |||
73 | size -= temp; | 73 | size -= temp; |
74 | next += temp; | 74 | next += temp; |
75 | } | 75 | } |
76 | up (&pools_lock); | 76 | mutex_unlock(&pools_lock); |
77 | 77 | ||
78 | return PAGE_SIZE - size; | 78 | return PAGE_SIZE - size; |
79 | } | 79 | } |
@@ -143,7 +143,7 @@ dma_pool_create (const char *name, struct device *dev, | |||
143 | if (dev) { | 143 | if (dev) { |
144 | int ret; | 144 | int ret; |
145 | 145 | ||
146 | down (&pools_lock); | 146 | mutex_lock(&pools_lock); |
147 | if (list_empty (&dev->dma_pools)) | 147 | if (list_empty (&dev->dma_pools)) |
148 | ret = device_create_file (dev, &dev_attr_pools); | 148 | ret = device_create_file (dev, &dev_attr_pools); |
149 | else | 149 | else |
@@ -155,7 +155,7 @@ dma_pool_create (const char *name, struct device *dev, | |||
155 | kfree(retval); | 155 | kfree(retval); |
156 | retval = NULL; | 156 | retval = NULL; |
157 | } | 157 | } |
158 | up (&pools_lock); | 158 | mutex_unlock(&pools_lock); |
159 | } else | 159 | } else |
160 | INIT_LIST_HEAD (&retval->pools); | 160 | INIT_LIST_HEAD (&retval->pools); |
161 | 161 | ||
@@ -231,11 +231,11 @@ pool_free_page (struct dma_pool *pool, struct dma_page *page) | |||
231 | void | 231 | void |
232 | dma_pool_destroy (struct dma_pool *pool) | 232 | dma_pool_destroy (struct dma_pool *pool) |
233 | { | 233 | { |
234 | down (&pools_lock); | 234 | mutex_lock(&pools_lock); |
235 | list_del (&pool->pools); | 235 | list_del (&pool->pools); |
236 | if (pool->dev && list_empty (&pool->dev->dma_pools)) | 236 | if (pool->dev && list_empty (&pool->dev->dma_pools)) |
237 | device_remove_file (pool->dev, &dev_attr_pools); | 237 | device_remove_file (pool->dev, &dev_attr_pools); |
238 | up (&pools_lock); | 238 | mutex_unlock(&pools_lock); |
239 | 239 | ||
240 | while (!list_empty (&pool->page_list)) { | 240 | while (!list_empty (&pool->page_list)) { |
241 | struct dma_page *page; | 241 | struct dma_page *page; |