Re: [PATCH v4 2/2] DMAEngine: Add DMAEngine driver based on old MSMADM DMA APIs

From: Lars-Peter Clausen
Date: Thu Mar 22 2012 - 07:48:06 EST


On 03/22/2012 11:58 AM, Ravi Kumar V wrote:
> [...]
> +static struct dma_async_tx_descriptor *msm_dma_prep_sg(
> + struct dma_chan *dchan,
> + struct scatterlist *dst_sg, unsigned int dst_nents,
> + struct scatterlist *src_sg, unsigned int src_nents,
> + unsigned long flags, void *context)
> +{
> [...]
> +
> + if (!dchan)
> + return ERR_PTR(-EINVAL);
> +
> + if (dst_nents == 0 || src_nents == 0)
> + return ERR_PTR(-EINVAL);
> + if (!dst_sg || !src_sg)
> + return ERR_PTR(-EINVAL);
> +
> + if ((dst_nents != src_nents) || (cmd_config->num_cmd != src_nents))
> + return ERR_PTR(-EINVAL);
> +
> + [...]
> +
> + if (!new) {
> + dev_err(chan->dev,
> + "No free memory for link descriptor\n");
> + return ERR_PTR(-ENOMEM);
> + }
> +
> [...]
> + return &new->async_tx;
> +}

Same comment as before. This is supposed to return either a valid descriptor
or NULL, but not an ERR_PTR.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/