Commit f4fd2ec0 authored by Fabien Dessenne's avatar Fabien Dessenne Committed by Vinod Koul

dmaengine: stm32-dma: use platform_get_irq()

platform_get_resource(pdev, IORESOURCE_IRQ) is not recommended for
requesting IRQ's resources, as they can be not ready yet. Using
platform_get_irq() instead is preferred for getting IRQ even if it was
not retrieved earlier.
Signed-off-by: default avatarFabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: default avatarPierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 8a6061c3
...@@ -1302,13 +1302,14 @@ static int stm32_dma_probe(struct platform_device *pdev) ...@@ -1302,13 +1302,14 @@ static int stm32_dma_probe(struct platform_device *pdev)
for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) { for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) {
chan = &dmadev->chan[i]; chan = &dmadev->chan[i];
res = platform_get_resource(pdev, IORESOURCE_IRQ, i); chan->irq = platform_get_irq(pdev, i);
if (!res) { if (chan->irq < 0) {
ret = -EINVAL; ret = chan->irq;
dev_err(&pdev->dev, "No irq resource for chan %d\n", i); if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev,
"No irq resource for chan %d\n", i);
goto err_unregister; goto err_unregister;
} }
chan->irq = res->start;
ret = devm_request_irq(&pdev->dev, chan->irq, ret = devm_request_irq(&pdev->dev, chan->irq,
stm32_dma_chan_irq, 0, stm32_dma_chan_irq, 0,
dev_name(chan2dev(chan)), chan); dev_name(chan2dev(chan)), chan);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment