summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/ofw
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-10-26 04:01:57 +0000
committerian <ian@FreeBSD.org>2014-10-26 04:01:57 +0000
commit8526d66c636337d8a561fa54ed24f881c8ad347a (patch)
treed30aae75ed4f574bdf983f60ce365f26ac1f52c7 /sys/powerpc/ofw
parent14eb39a57df6f6895c77b2d794c3b6a68e73542f (diff)
downloadFreeBSD-src-8526d66c636337d8a561fa54ed24f881c8ad347a.zip
FreeBSD-src-8526d66c636337d8a561fa54ed24f881c8ad347a.tar.gz
MFC r272109, r272181:
Replace multiple nearly-identical copies of code to walk through an FDT node's interrupts=<...> property creating resource list entries with a single common implementation. This change makes ofw_bus_intr_to_rl() the one true copy of that code and removes the copies of it from other places. This also adds handling of the interrupts-extended property.
Diffstat (limited to 'sys/powerpc/ofw')
-rw-r--r--sys/powerpc/ofw/ofw_pcibus.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c
index aa943ac..66fa341 100644
--- a/sys/powerpc/ofw/ofw_pcibus.c
+++ b/sys/powerpc/ofw/ofw_pcibus.c
@@ -200,29 +200,8 @@ ofw_pcibus_enum_devtree(device_t dev, u_int domain, u_int busno)
* interrupts property, so add that value to the device's
* resource list.
*/
- if (dinfo->opd_dinfo.cfg.intpin == 0) {
- ofw_pci_intr_t intr[2];
- phandle_t iparent;
- int icells;
-
- if (OF_getprop(child, "interrupts", &intr,
- sizeof(intr)) > 0) {
- iparent = 0;
- icells = 1;
- OF_getprop(child, "interrupt-parent", &iparent,
- sizeof(iparent));
- if (iparent != 0) {
- OF_getprop(OF_node_from_xref(iparent),
- "#interrupt-cells", &icells,
- sizeof(icells));
- intr[0] = ofw_bus_map_intr(dev, iparent,
- icells, intr);
- }
-
- resource_list_add(&dinfo->opd_dinfo.resources,
- SYS_RES_IRQ, 0, intr[0], intr[0], 1);
- }
- }
+ if (dinfo->opd_dinfo.cfg.intpin == 0)
+ ofw_bus_intr_to_rl(dev, child, &dinfo->opd_dinfo.resources);
}
}
OpenPOWER on IntegriCloud