Commit 4ced7ead authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] dmapool: use dev_err() whenever we can to get the better information in it.

parent c884ee80
......@@ -237,9 +237,12 @@ dma_pool_destroy (struct dma_pool *pool)
page = list_entry (pool->page_list.next,
struct dma_page, page_list);
if (is_page_busy (pool->blocks_per_page, page->bitmap)) {
printk (KERN_ERR "dma_pool_destroy %s/%s, %p busy\n",
pool->dev ? pool->dev->bus_id : NULL,
pool->name, page->vaddr);
if (pool->dev)
dev_err(pool->dev, "dma_pool_destroy %s, %p busy\n",
pool->name, page->vaddr);
else
printk (KERN_ERR "dma_pool_destroy %s, %p busy\n",
pool->name, page->vaddr);
/* leak the still-in-use consistent memory */
list_del (&page->page_list);
kfree (page);
......@@ -362,9 +365,12 @@ dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma)
int map, block;
if ((page = pool_find_page (pool, dma)) == 0) {
printk (KERN_ERR "dma_pool_free %s/%s, %p/%lx (bad dma)\n",
pool->dev ? pool->dev->bus_id : NULL,
pool->name, vaddr, (unsigned long) dma);
if (pool->dev)
dev_err(pool->dev, "dma_pool_free %s, %p/%lx (bad dma)\n",
pool->name, vaddr, (unsigned long) dma);
else
printk (KERN_ERR "dma_pool_free %s, %p/%lx (bad dma)\n",
pool->name, vaddr, (unsigned long) dma);
return;
}
......@@ -375,15 +381,21 @@ dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma)
#ifdef CONFIG_DEBUG_SLAB
if (((dma - page->dma) + (void *)page->vaddr) != vaddr) {
printk (KERN_ERR "dma_pool_free %s/%s, %p (bad vaddr)/%Lx\n",
pool->dev ? pool->dev->bus_id : NULL,
pool->name, vaddr, (unsigned long long) dma);
if (pool->dev)
dev_err(pool->dev, "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
pool->name, vaddr, (unsigned long long) dma);
else
printk (KERN_ERR "dma_pool_free %s, %p (bad vaddr)/%Lx\n",
pool->name, vaddr, (unsigned long long) dma);
return;
}
if (page->bitmap [map] & (1UL << block)) {
printk (KERN_ERR "dma_pool_free %s/%s, dma %Lx already free\n",
pool->dev ? pool->dev->bus_id : NULL,
pool->name, (unsigned long long)dma);
if (pool->dev)
dev_err(pool->dev, "dma_pool_free %s, dma %Lx already free\n",
pool->name, (unsigned long long)dma);
else
printk (KERN_ERR "dma_pool_free %s, dma %Lx already free\n",
pool->name, (unsigned long long)dma);
return;
}
memset (vaddr, POOL_POISON_FREED, pool->size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment