dma: ipu_idmac: reuse is_slave_direction helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 10 Jan 2013 08:53:00 +0000 (10:53 +0200)
committerVinod Koul <vinod.koul@intel.com>
Sat, 12 Jan 2013 13:07:22 +0000 (05:07 -0800)
The is_slave_direction helps to check if the transfer type is slave.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/ipu/ipu_idmac.c

index 6585537..8c61d17 100644 (file)
@@ -1347,7 +1347,7 @@ static struct dma_async_tx_descriptor *idmac_prep_slave_sg(struct dma_chan *chan
            chan->chan_id != IDMAC_IC_7)
                return NULL;
 
-       if (direction != DMA_DEV_TO_MEM && direction != DMA_MEM_TO_DEV) {
+       if (!is_slave_direction(direction)) {
                dev_err(chan->device->dev, "Invalid DMA direction %d!\n", direction);
                return NULL;
        }