]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/dma/mmp_tdma.c: use gen_pool_dma_alloc() to allocate descriptor
authorNicolin Chen <b42378@freescale.com>
Tue, 5 Nov 2013 05:56:50 +0000 (16:56 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:56:50 +0000 (16:56 +1100)
Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/dma/mmp_tdma.c

index 38cb517fb2ebd82034b02e2ab7d5cabfc9992cbd..d3b6358e5a27037281f6da2efb6dad3e926b9fb1 100644 (file)
@@ -350,12 +350,7 @@ struct mmp_tdma_desc *mmp_tdma_alloc_descriptor(struct mmp_tdma_chan *tdmac)
        if (!gpool)
                return NULL;
 
-       tdmac->desc_arr = (void *)gen_pool_alloc(gpool, size);
-       if (!tdmac->desc_arr)
-               return NULL;
-
-       tdmac->desc_arr_phys = gen_pool_virt_to_phys(gpool,
-                       (unsigned long)tdmac->desc_arr);
+       tdmac->desc_arr = gen_pool_dma_alloc(gpool, size, &tdmac->desc_arr_phys);
 
        return tdmac->desc_arr;
 }