diff options
author | Fabien Dessenne <fabien.dessenne@st.com> | 2019-04-24 05:21:25 -0400 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2019-04-26 13:03:34 -0400 |
commit | f4fd2ec08f17b34f1c7c18414d5fc882efd51e83 (patch) | |
tree | b29814a2e91e86f3c4ec2e82bd854284e1deee09 | |
parent | 8a6061c34a54a997db1ded6d89b7db6cbe3f359e (diff) |
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: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r-- | drivers/dma/stm32-dma.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index ba239b529fa9..33068185c0fe 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c | |||
@@ -1302,13 +1302,14 @@ static int stm32_dma_probe(struct platform_device *pdev) | |||
1302 | 1302 | ||
1303 | for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) { | 1303 | for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) { |
1304 | chan = &dmadev->chan[i]; | 1304 | chan = &dmadev->chan[i]; |
1305 | res = platform_get_resource(pdev, IORESOURCE_IRQ, i); | 1305 | chan->irq = platform_get_irq(pdev, i); |
1306 | if (!res) { | 1306 | if (chan->irq < 0) { |
1307 | ret = -EINVAL; | 1307 | ret = chan->irq; |
1308 | dev_err(&pdev->dev, "No irq resource for chan %d\n", i); | 1308 | if (ret != -EPROBE_DEFER) |
1309 | dev_err(&pdev->dev, | ||
1310 | "No irq resource for chan %d\n", i); | ||
1309 | goto err_unregister; | 1311 | goto err_unregister; |
1310 | } | 1312 | } |
1311 | chan->irq = res->start; | ||
1312 | ret = devm_request_irq(&pdev->dev, chan->irq, | 1313 | ret = devm_request_irq(&pdev->dev, chan->irq, |
1313 | stm32_dma_chan_irq, 0, | 1314 | stm32_dma_chan_irq, 0, |
1314 | dev_name(chan2dev(chan)), chan); | 1315 | dev_name(chan2dev(chan)), chan); |