diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2026-05-09 02:42:50 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2026-06-04 05:14:42 +0000 |
| commit | b230a7b9a52c0fc948f4f1dcd1225a94674073f6 (patch) | |
| tree | 6876fe4b0581d1fbf5f9a2ccddbb021b887ccbca | |
| parent | 72e57bc264179818f55b49deb97bc40f56c2b936 (diff) | |
kern: ofw: provide ofw_bus_destroy_iinfo to teardown interrupt-map
For symmetry with ofw_bus_setup_iinfo, the next commits will use it to
properly cleanup on failure in bcm2838_pci.
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D56895
| -rw-r--r-- | sys/dev/ofw/ofw_bus_subr.c | 12 | ||||
| -rw-r--r-- | sys/dev/ofw/ofw_bus_subr.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c index efca3ea14e2f..e4779ff74e48 100644 --- a/sys/dev/ofw/ofw_bus_subr.c +++ b/sys/dev/ofw/ofw_bus_subr.c @@ -358,6 +358,18 @@ ofw_bus_setup_iinfo(phandle_t node, struct ofw_bus_iinfo *ii, int intrsz) } } +void +ofw_bus_destroy_iinfo(struct ofw_bus_iinfo *ii) +{ + + if (ii->opi_imapsz > 0) { + OF_prop_free(ii->opi_imapmsk); + ii->opi_imapsz = 0; + } + + OF_prop_free(ii->opi_imap); +} + int ofw_bus_lookup_imap(phandle_t node, struct ofw_bus_iinfo *ii, void *reg, int regsz, void *pintr, int pintrsz, void *mintr, int mintrsz, diff --git a/sys/dev/ofw/ofw_bus_subr.h b/sys/dev/ofw/ofw_bus_subr.h index 203c9689f156..89732f5570a7 100644 --- a/sys/dev/ofw/ofw_bus_subr.h +++ b/sys/dev/ofw/ofw_bus_subr.h @@ -86,6 +86,7 @@ bus_get_device_path_t ofw_bus_gen_get_device_path; /* Routines for processing firmware interrupt maps */ void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int); +void ofw_bus_destroy_iinfo(struct ofw_bus_iinfo *); int ofw_bus_lookup_imap(phandle_t, struct ofw_bus_iinfo *, void *, int, void *, int, void *, int, phandle_t *); int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, |
