mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code
The dma_mapping_error() function returns true if there is an error, it doesn't return an error code. We should return -ENOMEM. Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Axel Lin <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Cc: [email protected]
This commit is contained in:
parent
480b141abf
commit
a4a9a8cb32
1 changed files with 4 additions and 4 deletions
|
|
@ -198,10 +198,10 @@ static int slimpro_i2c_blkrd(struct slimpro_i2c_dev *ctx, u32 chip, u32 addr,
|
|||
int rc;
|
||||
|
||||
paddr = dma_map_single(ctx->dev, ctx->dma_buffer, readlen, DMA_FROM_DEVICE);
|
||||
rc = dma_mapping_error(ctx->dev, paddr);
|
||||
if (rc) {
|
||||
if (dma_mapping_error(ctx->dev, paddr)) {
|
||||
dev_err(&ctx->adapter.dev, "Error in mapping dma buffer %p\n",
|
||||
ctx->dma_buffer);
|
||||
rc = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
|
@ -241,10 +241,10 @@ static int slimpro_i2c_blkwr(struct slimpro_i2c_dev *ctx, u32 chip,
|
|||
memcpy(ctx->dma_buffer, data, writelen);
|
||||
paddr = dma_map_single(ctx->dev, ctx->dma_buffer, writelen,
|
||||
DMA_TO_DEVICE);
|
||||
rc = dma_mapping_error(ctx->dev, paddr);
|
||||
if (rc) {
|
||||
if (dma_mapping_error(ctx->dev, paddr)) {
|
||||
dev_err(&ctx->adapter.dev, "Error in mapping dma buffer %p\n",
|
||||
ctx->dma_buffer);
|
||||
rc = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue