[PATCH v2] drivers: altera_edac: Guard SDRAM irq2 retrieval for Arria10 only
muhammad.nazim.amirul.nazle.asmade at altera.com
muhammad.nazim.amirul.nazle.asmade at altera.com
Wed May 13 20:40:07 PDT 2026
From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade at altera.com>
Guard the irq2 retrieval with an of_machine_is_compatible() check so
that platform_get_irq(pdev, 1) is only called on Arria10 platforms.
Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade at altera.com>
---
v2: Move irq2 = platform_get_irq(pdev, 1) inside the existing
of_machine_is_compatible("altr,socfpga-arria10") block instead of
adding a separate duplicate guard around it.
---
drivers/edac/altera_edac.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 4edd2088c2db..ee6ced033f2c 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -347,9 +347,6 @@ static int altr_sdram_probe(struct platform_device *pdev)
return irq;
}
- /* Arria10 has a 2nd IRQ */
- irq2 = platform_get_irq(pdev, 1);
-
layers[0].type = EDAC_MC_LAYER_CHIP_SELECT;
layers[0].size = 1;
layers[0].is_virt_csrow = true;
@@ -395,6 +392,9 @@ static int altr_sdram_probe(struct platform_device *pdev)
/* Only the Arria10 has separate IRQs */
if (of_machine_is_compatible("altr,socfpga-arria10")) {
+ /* Arria10 has a 2nd IRQ */
+ irq2 = platform_get_irq(pdev, 1);
+
/* Arria10 specific initialization */
res = a10_init(mc_vbase);
if (res < 0)
--
2.43.7
More information about the linux-arm-kernel
mailing list