[PATCH V4 02/14] DMA: PL330: Update PL330 DMA API driver

Jassi Brar jassisinghbrar at gmail.com
Mon Jul 25 04:57:59 EDT 2011


On Mon, Jul 25, 2011 at 6:58 AM, Boojin Kim <boojin.kim at samsung.com> wrote:

> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index b7ecf47..586ab39 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -455,7 +455,7 @@ static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
>        async_tx_ack(&desc->txd);
>
>        desc->req.rqtype = peri->rqtype;
> -       desc->req.peri = peri->peri_id;
> +       desc->req.peri = pch->chan.chan_id;
Btw, I plan to revert this if my patch is accepted that proposes
to free chan_id solely for use by DMAC drivers(which we should
employ to pass paltform assigned channel ID to client drivers)

> @@ -748,17 +747,19 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
>                struct dma_pl330_peri *peri = &pdat->peri[i];
>                pch = &pdmac->peripherals[i];
>
> -               switch (peri->rqtype) {
> -               case MEMTOMEM:
> -                       dma_cap_set(DMA_MEMCPY, pd->cap_mask);
> -                       break;
> -               case MEMTODEV:
> -               case DEVTOMEM:
> -                       dma_cap_set(DMA_SLAVE, pd->cap_mask);
> -                       break;
> -               default:
> -                       dev_err(&adev->dev, "DEVTODEV Not Supported\n");
> -                       continue;
> +               if (peri) {
> +                       switch (peri->rqtype) {
> +                       case MEMTOMEM:
> +                               dma_cap_set(DMA_MEMCPY, pd->cap_mask);
> +                               break;
> +                       case MEMTODEV:
> +                       case DEVTOMEM:
> +                               dma_cap_set(DMA_SLAVE, pd->cap_mask);
> +                               break;
> +                       default:
> +                               dev_err(&adev->dev, "DEVTODEV Not Supported\n");
> +                               continue;
> +                       }
>                }
If you pass platform data correctly, you don't need to check against NULL peri.


More information about the linux-arm-kernel mailing list