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:
parent
c08215ada6
commit
0761bf2d22
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue