[PATCH] Allow overlapping resources for platform devices
authorKumar Gala <galak@gate.crashing.org>
Mon, 28 Nov 2005 16:15:39 +0000 (10:15 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 5 Jan 2006 00:18:08 +0000 (16:18 -0800)
There are cases in which a device's memory mapped registers overlap
with another device's memory mapped registers.  On several PowerPC
devices this occurs for the MDIO bus, whose registers tended to overlap
with one of the ethernet controllers.

By switching from request_resource to insert_resource we can register
the MDIO bus as a proper platform device and not hack around how we
handle its memory mapped registers.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/platform.c

index 8827dafba9451a7f741b9330eb0e87b58210ab3f..1091af1cbb582a10e0c5afbf4857f4c45e2cf16b 100644 (file)
@@ -257,7 +257,7 @@ int platform_device_add(struct platform_device *pdev)
                                p = &ioport_resource;
                }
 
-               if (p && request_resource(p, r)) {
+               if (p && insert_resource(p, r)) {
                        printk(KERN_ERR
                               "%s: failed to claim resource %d\n",
                               pdev->dev.bus_id, i);