Commit 461cd370 authored by Akhil R's avatar Akhil R Committed by Vinod Koul

dmaengine: tegra: Use platform_get_irq() to get IRQ resource

Use platform_irq_get() instead platform_get_resource() for IRQ resource
to fix the probe failure. platform_get_resource() fails to fetch the IRQ
resource as it might not be ready at that time.

platform_irq_get() is also the recommended way to get interrupt as it
directly gives the IRQ number and no conversion from resource is
required.

Fixes: ee170280 ("dmaengine: tegra: Add tegra gpcdma driver")
Reported-by: default avatarJonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarAkhil R <akhilrajeev@nvidia.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20220505091440.12981-1-akhilrajeev@nvidia.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 99faef48
......@@ -1328,7 +1328,6 @@ static int tegra_dma_probe(struct platform_device *pdev)
struct iommu_fwspec *iommu_spec;
unsigned int stream_id, i;
struct tegra_dma *tdma;
struct resource *res;
int ret;
cdata = of_device_get_match_data(&pdev->dev);
......@@ -1367,16 +1366,13 @@ static int tegra_dma_probe(struct platform_device *pdev)
for (i = 0; i < cdata->nr_channels; i++) {
struct tegra_dma_channel *tdc = &tdma->channels[i];
tdc->irq = platform_get_irq(pdev, i);
if (tdc->irq < 0)
return tdc->irq;
tdc->chan_base_offset = TEGRA_GPCDMA_CHANNEL_BASE_ADD_OFFSET +
i * cdata->channel_reg_size;
res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
if (!res) {
dev_err(&pdev->dev, "No irq resource for chan %d\n", i);
return -EINVAL;
}
tdc->irq = res->start;
snprintf(tdc->name, sizeof(tdc->name), "gpcdma.%d", i);
tdc->tdma = tdma;
tdc->id = i;
tdc->slave_id = -1;
......
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