Commit b5fffe28 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] Driver Core: handle bridged platform bus segments

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).
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 3901d84d
......@@ -141,11 +141,13 @@ int platform_device_register(struct platform_device * pdev)
if (r->name == NULL)
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment