* [PATCH net] net: gianfar: use of_irq_get()
@ 2026-06-24 3:21 Rosen Penev
0 siblings, 0 replies; only message in thread
From: Rosen Penev @ 2026-06-24 3:21 UTC (permalink / raw)
To: netdev
Cc: Claudiu Manoil, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Andy Fleming, open list
of_irq_get() differs from irq_of_parse_and_map() in that the latter
requires calling irq_dispose_mapping() when done, which is missing in the
driver. Meaning it leaks memory.
No need to map it anyway. Just need the value stored in the irq field.
Changed irq to an int as required by the of_irq_get API as it supports
-EPROBE_DEFER.
Fixes: b31a1d8b4151 ("gianfar: Convert gianfar to an of_platform_driver")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/freescale/gianfar.c | 12 ++++++------
drivers/net/ethernet/freescale/gianfar.h | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 3271de5844f8..17a0d0787ed2 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -514,15 +514,15 @@ static int gfar_parse_group(struct device_node *np,
if (!grp->regs)
return -ENOMEM;
- gfar_irq(grp, TX)->irq = irq_of_parse_and_map(np, 0);
+ gfar_irq(grp, TX)->irq = of_irq_get(np, 0);
/* If we aren't the FEC we have multiple interrupts */
if (model && strcasecmp(model, "FEC")) {
- gfar_irq(grp, RX)->irq = irq_of_parse_and_map(np, 1);
- gfar_irq(grp, ER)->irq = irq_of_parse_and_map(np, 2);
- if (!gfar_irq(grp, TX)->irq ||
- !gfar_irq(grp, RX)->irq ||
- !gfar_irq(grp, ER)->irq)
+ gfar_irq(grp, RX)->irq = of_irq_get(np, 1);
+ gfar_irq(grp, ER)->irq = of_irq_get(np, 2);
+ if (gfar_irq(grp, TX)->irq < 0 ||
+ gfar_irq(grp, RX)->irq < 0 ||
+ gfar_irq(grp, ER)->irq < 0)
return -EINVAL;
}
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 68b59d3202e3..c6f1c0b6229e 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -1074,7 +1074,7 @@ enum gfar_irqinfo_id {
};
struct gfar_irqinfo {
- unsigned int irq;
+ int irq;
char name[GFAR_INT_NAME_MAX];
};
--
2.54.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-24 3:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24 3:21 [PATCH net] net: gianfar: use of_irq_get() Rosen Penev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.