ChangeSet 1.1500.11.6, 2004/02/02 11:29:59-08:00, greg@kroah.com [PATCH] dmapool: use dev_err() whenever we can to get the better information in it. drivers/base/dmapool.c | 36 ++++++++++++++++++++++++------------ 1 files changed, 24 insertions(+), 12 deletions(-) diff -Nru a/drivers/base/dmapool.c b/drivers/base/dmapool.c --- a/drivers/base/dmapool.c Mon Feb 9 14:59:26 2004 +++ b/drivers/base/dmapool.c Mon Feb 9 14:59:26 2004 @@ -237,9 +237,12 @@ 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 @@ 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 @@ #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);