diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-20 08:37:19 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-10-22 20:08:27 +0200 |
commit | 8267f16e8b67ea272f37f7072933dc0d3839693d (patch) | |
tree | 672a25b5bb2db8c1a440d0221d1069231071f6aa /drivers/dma/imx-dma.c | |
parent | Merge branch 'dma40' into dmaengine (diff) | |
download | linux-8267f16e8b67ea272f37f7072933dc0d3839693d.tar.xz linux-8267f16e8b67ea272f37f7072933dc0d3839693d.zip |
dma: imx-dma: fix signedness bug
mxdmac->channel was unsigned, so check (imxdmac->channel < 0) for
failed imx_dma_request_by_prio() made no sence. Explicitly check
signed values.
Also, fix uninitialzed use of ret.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/imx-dma.c')
-rw-r--r-- | drivers/dma/imx-dma.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 346be6218058..f629e4961af5 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -335,8 +335,10 @@ static int __init imxdma_probe(struct platform_device *pdev) imxdmac->imxdma_channel = imx_dma_request_by_prio("dmaengine", DMA_PRIO_MEDIUM); - if (imxdmac->channel < 0) + if ((int)imxdmac->channel < 0) { + ret = -ENODEV; goto err_init; + } imx_dma_setup_handlers(imxdmac->imxdma_channel, imxdma_irq_handler, imxdma_err_handler, imxdmac); |