svn commit: r260912 - head/sys/x86/x86

John Baldwin jhb at FreeBSD.org
Mon Jan 20 17:55:22 UTC 2014


Author: jhb
Date: Mon Jan 20 17:55:22 2014
New Revision: 260912
URL: http://svnweb.freebsd.org/changeset/base/260912

Log:
  - Only check the ivars for direct descendants.
  - A couple of whitespace fixes.

Modified:
  head/sys/x86/x86/nexus.c

Modified: head/sys/x86/x86/nexus.c
==============================================================================
--- head/sys/x86/x86/nexus.c	Mon Jan 20 17:45:36 2014	(r260911)
+++ head/sys/x86/x86/nexus.c	Mon Jan 20 17:55:22 2014	(r260912)
@@ -368,12 +368,13 @@ nexus_alloc_resource(device_t bus, devic
 	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)


More information about the svn-src-head mailing list