9
0
Fork 0

of: When checking for existing devices also check resource end

When registering devices from the devicetree we check if these
devices already exist. When doing this not only check the resource
start but also the resource end.
This helps with the probing of simple buses for which child nodes
often begin at the very same address as the parents.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-05-19 07:42:28 +02:00
parent c08215ada6
commit 0761bf2d22
1 changed files with 2 additions and 1 deletions

View File

@ -970,7 +970,8 @@ static int add_of_device_resource(struct device_node *node)
for_each_device(dev) {
if (!dev->resource)
continue;
if (dev->resource->start == address) {
if (dev->resource->start == res->start &&
dev->resource->end == res->end) {
debug("connecting %s to %s\n", node->name, dev_name(dev));
node->device = dev;
dev->device_node = node;