[PATCH 6/7] spi/s3c64xx: Add support DMA engine API

Chanho Park parkch98 at gmail.com
Tue Jul 5 04:39:50 EDT 2011


>  static int acquire_dma(struct s3c64xx_spi_driver_data *sdd)
>  {
> +#if defined(CONFIG_DMADEV_PL330)
> +       dma_cap_mask_t mask;
> +       dma_cap_zero(mask);
> +       dma_cap_set(DMA_SLAVE, mask);
> +       sdd->rx_chan =
> +               dma_request_channel(mask, rxfilter, (void *)sdd);
> +       if (!sdd->rx_chan) {
> +               dev_err(&sdd->pdev->dev, "cannot get RxDMA\n");
> +               return 0;
> +       }
> +       sdd->tx_chan =
> +               dma_request_channel(mask, txfilter, (void *)sdd);
> +       if (!sdd->tx_chan) {
> +               dev_err(&sdd->pdev->dev, "cannot get TxDMA\n");
> +               return 0;
> +       }
> +#else

When acquiring tx_chan is failed, you must release a rx_chan before
error return.
If not, the rx_chan is always busy because it was allocated in the
previous attempt.

-- 
Best Regards,
Chanho Park



More information about the linux-arm-kernel mailing list