Skip to contentSkip to conversation

handle bridged platform bus segments

PATCH New David Brownell 1 participant 1 message Dec 18, 2004 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 handle bridged platform bus segments

There's an inappropriate assumption that platform_bus has only one top-level segment; trivially fixed.

- Dave

During setup to access platform bus segments through bridges, the current platform_device_register() ignores the resource parent specified by the bridge. That means it'll always detect a (false) resource conflict with the bridge, and fail the resource reservation step.

This patch makes that code use the specified parent resource, defaulting to "iomem_resource" or "ioport_resource" only for a NULL parent (that is, for devices that aren't accessed through a bridge).

drivers/base/platform.c +7 -5
@@ -105,11 +105,13 @@
 
 		r->name = pdev->dev.bus_id;
 
-		p = NULL;
-		if (r->flags & IORESOURCE_MEM)
-			p = &iomem_resource;
-		else if (r->flags & IORESOURCE_IO)
-			p = &ioport_resource;
+		p = r->parent;
+		if (!p) {
+			if (r->flags & IORESOURCE_MEM)
+				p = &iomem_resource;
+			else if (r->flags & IORESOURCE_IO)
+				p = &ioport_resource;
+		}
 
 		if (p && request_resource(p, r)) {
 			printk(KERN_ERR