Re: [PATCH] EDAC/altera: Refactor exit paths in altr_portb_setup()
From: Dinh Nguyen
Date: Fri Oct 02 2026 - 17:43:55 EST
On 10/1/26 12:15, Rounak Das wrote:
altr_portb_setup() has a single caller, socfpga_init_sdmmc_ecc(), whichVery nice, this looks good to me!
looks up the same SDMMC ECC node and holds a reference to it across the
call. Pass that node in instead of looking it up a second time. This makes
altr_portb_setup() lose its lookup and its of_node_put() calls. The caller
drops its reference at every path.
Convert the remaining unwinding to one goto label per resource. Each
exit path undid its own acquisitions by hand, so commit 7d5a36a5490d
("EDAC/altera: Fix device node reference leaks in the SDMMC ECC setup")
had to add the same of_node_put() calls to four of them.
While at it, replace the two comments on the PortB IRQ index with one
that describes the interrupt layout, and select the index with a
ternary.
A devres_open_group() failure now also prints the common error
message. No other functional change intended.
Suggested-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Link: https://lore.kernel.org/all/20260926185955.GAargWKzpAwXXC4CQW@fat_crate.local/
Signed-off-by: Rounak Das <rounakdas2025@xxxxxxxxx>
---
drivers/edac/altera_edac.c | 45 ++++++++++++++------------------------
1 file changed, 16 insertions(+), 29 deletions(-)
Acked-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>