mm/dmapool.c: reuse devres_release() to free resources
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 4 Jun 2014 23:10:02 +0000 (16:10 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jun 2014 23:54:08 +0000 (16:54 -0700)
Instead of calling an additional routine in dmam_pool_destroy() rely on
what dmam_pool_release() is doing.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/dmapool.c

index a3a1bfe..306baa5 100644 (file)
@@ -500,7 +500,6 @@ void dmam_pool_destroy(struct dma_pool *pool)
 {
        struct device *dev = pool->dev;
 
-       WARN_ON(devres_destroy(dev, dmam_pool_release, dmam_pool_match, pool));
-       dma_pool_destroy(pool);
+       WARN_ON(devres_release(dev, dmam_pool_release, dmam_pool_match, pool));
 }
 EXPORT_SYMBOL(dmam_pool_destroy);