[PATCH 2/2] dmaengine: s3c24xx-dma: Add cyclic transfer support

Vasily Khoruzhick anarsoul at gmail.com
Mon May 19 08:34:41 PDT 2014


Hi Andy,

On Mon, May 19, 2014 at 11:40 AM, Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>> +
>> +     if (direction == DMA_MEM_TO_DEV) {
>> +             txd->disrcc = S3C24XX_DISRCC_LOC_AHB |
>> +                           S3C24XX_DISRCC_INC_INCREMENT;
>> +             txd->didstc = hwcfg;
>> +             slave_addr = s3cchan->cfg.dst_addr;
>> +             txd->width = s3cchan->cfg.dst_addr_width;
>> +     } else if (direction == DMA_DEV_TO_MEM) {
>> +             txd->disrcc = hwcfg;
>> +             txd->didstc = S3C24XX_DIDSTC_LOC_AHB |
>> +                           S3C24XX_DIDSTC_INC_INCREMENT;
>> +             slave_addr = s3cchan->cfg.src_addr;
>> +             txd->width = s3cchan->cfg.src_addr_width;
>> +     } else {
>> +             s3c24xx_dma_free_txd(txd);
>> +             dev_err(&s3cdma->pdev->dev,
>> +                     "direction %d unsupported\n", direction);
>> +             return NULL;
>> +     }
>
> Instead of doing this, you may put few lines on top of function
>
> if (!is_slave_direction) {
>         dev_err(&s3cdma->pdev->dev, "direction %d unsupported\n", direction);
>         return NULL;
> }
>
> As an additional effect you can transform the 'else if' to just 'else' above the code.

Sounds reasonable, will resend v2 in few mins.

Regards
Vasily

> --
> Andy Shevchenko <andriy.shevchenko at intel.com>
> Intel Finland Oy



More information about the linux-arm-kernel mailing list