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:
Sascha Hauer 2010-10-20 08:37:19 +02:00 коммит произвёл Dan Williams
Родитель 42e55736f7
Коммит 8267f16e8b
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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);