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>
This commit is contained in:
committed by
Dan Williams
parent
42e55736f7
commit
8267f16e8b
@@ -335,8 +335,10 @@ static int __init imxdma_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
imxdmac->imxdma_channel = imx_dma_request_by_prio("dmaengine",
|
imxdmac->imxdma_channel = imx_dma_request_by_prio("dmaengine",
|
||||||
DMA_PRIO_MEDIUM);
|
DMA_PRIO_MEDIUM);
|
||||||
if (imxdmac->channel < 0)
|
if ((int)imxdmac->channel < 0) {
|
||||||
|
ret = -ENODEV;
|
||||||
goto err_init;
|
goto err_init;
|
||||||
|
}
|
||||||
|
|
||||||
imx_dma_setup_handlers(imxdmac->imxdma_channel,
|
imx_dma_setup_handlers(imxdmac->imxdma_channel,
|
||||||
imxdma_irq_handler, imxdma_err_handler, imxdmac);
|
imxdma_irq_handler, imxdma_err_handler, imxdmac);
|
||||||
|
Reference in New Issue
Block a user