diff options
author | jhb <jhb@FreeBSD.org> | 2014-01-20 17:55:22 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2014-01-20 17:55:22 +0000 |
commit | 094f2691cab2836b1d441da0c8e114c402630dc1 (patch) | |
tree | 9bcda6f6db569acb6d5775230edd1b0d09354b11 | |
parent | 39f46280d5e81df8a08298cf71660aa89c5fdd37 (diff) | |
download | FreeBSD-src-094f2691cab2836b1d441da0c8e114c402630dc1.zip FreeBSD-src-094f2691cab2836b1d441da0c8e114c402630dc1.tar.gz |
- Only check the ivars for direct descendants.
- A couple of whitespace fixes.
-rw-r--r-- | sys/x86/x86/nexus.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c index 9ead8c8..f74299c 100644 --- a/sys/x86/x86/nexus.c +++ b/sys/x86/x86/nexus.c @@ -368,12 +368,13 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, int needactivate = flags & RF_ACTIVE; /* - * If this is an allocation of the "default" range for a given RID, and - * we know what the resources for this device are (ie. they aren't maintained - * by a child bus), then work out the start/end values. + * If this is an allocation of the "default" range for a given + * RID, and we know what the resources for this device are + * (ie. they aren't maintained by a child bus), then work out + * the start/end values. */ if ((start == 0UL) && (end == ~0UL) && (count == 1)) { - if (ndev == NULL) + if (device_get_parent(child) != bus || ndev == NULL) return(NULL); rle = resource_list_find(&ndev->nx_resources, type, *rid); if (rle == NULL) @@ -492,6 +493,7 @@ static int nexus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + if (rman_get_flags(r) & RF_ACTIVE) { int error = bus_deactivate_resource(child, type, rid, r); if (error) |