summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw/ofwbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ofw/ofwbus.c')
-rw-r--r--sys/dev/ofw/ofwbus.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c
index 142ee1a..8eb5dd5 100644
--- a/sys/dev/ofw/ofwbus.c
+++ b/sys/dev/ofw/ofwbus.c
@@ -186,7 +186,7 @@ ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
struct resource_list_entry *rle;
int isdefault, passthrough;
- isdefault = (start == 0UL && end == ~0UL);
+ isdefault = RMAN_IS_DEFAULT_RANGE(start, end);
passthrough = (device_get_parent(child) != bus);
sc = device_get_softc(bus);
rle = NULL;
@@ -271,12 +271,17 @@ ofwbus_release_resource(device_t bus, device_t child, int type,
int rid, struct resource *r)
{
struct resource_list_entry *rle;
+ int passthrough;
int error;
- /* Clean resource list entry */
- rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, rid);
- if (rle != NULL)
- rle->res = NULL;
+ passthrough = (device_get_parent(child) != bus);
+ if (!passthrough) {
+ /* Clean resource list entry */
+ rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child),
+ type, rid);
+ if (rle != NULL)
+ rle->res = NULL;
+ }
if ((rman_get_flags(r) & RF_ACTIVE) != 0) {
error = bus_deactivate_resource(child, type, rid, r);
OpenPOWER on IntegriCloud