The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3] EDAC/altera: Guard SDRAM irq2 retrieval for Arria10 only
@ 2026-05-15  5:04 muhammad.nazim.amirul.nazle.asmade
  2026-05-15 11:41 ` Dinh Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: muhammad.nazim.amirul.nazle.asmade @ 2026-05-15  5:04 UTC (permalink / raw)
  To: dinguyen, bp, tony.luck; +Cc: linux-edac, linux-arm-kernel, linux-kernel

From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@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@altera.com>
---
v3: Fix commit header formatting to follow EDAC/altera: prefix
    convention as per maintainer feedback.
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] EDAC/altera: Guard SDRAM irq2 retrieval for Arria10 only
  2026-05-15  5:04 [PATCH v3] EDAC/altera: Guard SDRAM irq2 retrieval for Arria10 only muhammad.nazim.amirul.nazle.asmade
@ 2026-05-15 11:41 ` Dinh Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Dinh Nguyen @ 2026-05-15 11:41 UTC (permalink / raw)
  To: muhammad.nazim.amirul.nazle.asmade, bp, tony.luck
  Cc: linux-edac, linux-arm-kernel, linux-kernel



On 5/15/26 00:04, muhammad.nazim.amirul.nazle.asmade@altera.com wrote:
> From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@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@altera.com>
> ---
> v3: Fix commit header formatting to follow EDAC/altera: prefix
>      convention as per maintainer feedback.
> 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)

Acked-by: Dinh Nguyen <dinguyen@kernel.org>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-15 11:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15  5:04 [PATCH v3] EDAC/altera: Guard SDRAM irq2 retrieval for Arria10 only muhammad.nazim.amirul.nazle.asmade
2026-05-15 11:41 ` Dinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox