Skip to content

Commit 884c65e

Browse files
Jean-Philippe Bruckerkuba-moo
authored andcommitted
amd-xgbe: Use platform_irq_count()
The AMD XGbE driver currently counts the number of interrupts assigned to the device by inspecting the pdev->resource array. Since commit a1a2b71 ("of/platform: Drop static setup of IRQ resource from DT core") removed IRQs from this array, the driver now attempts to get all interrupts from 1 to -1U and gives up probing once it reaches an invalid interrupt index. Obtain the number of IRQs with platform_irq_count() instead. Fixes: a1a2b71 ("of/platform: Drop static setup of IRQ resource from DT core") Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Tom Lendacky <thomas.lendacky@amd.com> Link: https://lore.kernel.org/r/20220609161457.69614-1-jean-philippe@linaro.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 619c010 commit 884c65e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/ethernet/amd/xgbe/xgbe-platform.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)
338338
* the PHY resources listed last
339339
*/
340340
phy_memnum = xgbe_resource_count(pdev, IORESOURCE_MEM) - 3;
341-
phy_irqnum = xgbe_resource_count(pdev, IORESOURCE_IRQ) - 1;
341+
phy_irqnum = platform_irq_count(pdev) - 1;
342342
dma_irqnum = 1;
343343
dma_irqend = phy_irqnum;
344344
} else {
@@ -348,7 +348,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)
348348
phy_memnum = 0;
349349
phy_irqnum = 0;
350350
dma_irqnum = 1;
351-
dma_irqend = xgbe_resource_count(pdev, IORESOURCE_IRQ);
351+
dma_irqend = platform_irq_count(pdev);
352352
}
353353

354354
/* Obtain the mmio areas for the device */

0 commit comments

Comments
 (0)