lkml.org 
[lkml]   [2020]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 6/9] spi: spi-s3c64xx: Check return values
From
Date
On 8/21/20 18:13, Łukasz Stelmach wrote:
> Check return values in prepare_dma() and s3c64xx_spi_config() and
> propagate errors upwards.
>
> Signed-off-by: Łukasz Stelmach<l.stelmach@samsung.com>
> ---
> drivers/spi/spi-s3c64xx.c | 47 ++++++++++++++++++++++++++++++++-------
> 1 file changed, 39 insertions(+), 8 deletions(-)

> @@ -298,12 +299,24 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
>
> desc = dmaengine_prep_slave_sg(dma->ch, sgt->sgl, sgt->nents,
> dma->direction, DMA_PREP_INTERRUPT);
> + if (!desc) {
> + dev_err(&sdd->pdev->dev, "unable to prepare %s scatterlist",
> + dma->direction == DMA_DEV_TO_MEM ? "rx" : "tx");
> + return -ENOMEM;
> + }
>
> desc->callback = s3c64xx_spi_dmacb;
> desc->callback_param = dma;
>
> dma->cookie = dmaengine_submit(desc);
> + ret = dma_submit_error(dma->cookie);
> + if (ret) {
> + dev_err(&sdd->pdev->dev, "DMA submission failed");
> + return -EIO;

Just return the error value from dma_submit_error() here?


\
 
 \ /
  Last update: 2020-08-25 21:06    [W:0.236 / U:5.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site