From: Martin Oliveira Date: Thu, 29 Jul 2021 20:15:27 +0000 (-0600) Subject: MIPS/jazzdma: return error code from jazz_dma_map_sg() X-Git-Tag: v5.15-rc1~124^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af82fe85665d49bdb72dba66cd57e3bf95b71895;p=thirdparty%2Fkernel%2Flinux.git MIPS/jazzdma: return error code from jazz_dma_map_sg() The .map_sg() op now expects an error code instead of zero on failure. vdma_alloc() may fail for different reasons, but since it only supports indicating an error via a return of DMA_MAPPING_ERROR, we coalesce the different reasons into -EIO as is documented on dma_map_sgtable(). Signed-off-by: Martin Oliveira Signed-off-by: Logan Gunthorpe Cc: Thomas Bogendoerfer Signed-off-by: Christoph Hellwig --- diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c index 461457b289828..eabddb89d221f 100644 --- a/arch/mips/jazz/jazzdma.c +++ b/arch/mips/jazz/jazzdma.c @@ -552,7 +552,7 @@ static int jazz_dma_map_sg(struct device *dev, struct scatterlist *sglist, dir); sg->dma_address = vdma_alloc(sg_phys(sg), sg->length); if (sg->dma_address == DMA_MAPPING_ERROR) - return 0; + return -EIO; sg_dma_len(sg) = sg->length; }