Re: [PATCH] USB and Driver Core patches for 2.6.10

From: Greg KH
Date: Sat Jan 08 2005 - 03:06:44 EST


ChangeSet 1.1938.439.49, 2005/01/06 17:28:25-08:00, david-b@xxxxxxxxxxx

[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: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>


drivers/base/platform.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)


diff -Nru a/drivers/base/platform.c b/drivers/base/platform.c
--- a/drivers/base/platform.c 2005-01-07 15:38:05 -08:00
+++ b/drivers/base/platform.c 2005-01-07 15:38:05 -08:00
@@ -141,11 +141,13 @@
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/