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
This commit is contained in:
Kyle Evans
2026-05-08 21:42:50 -05:00
parent 72e57bc264
commit b230a7b9a5
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -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,
+1
View File
@@ -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 *,