[PATCH 5/8] of: When checking for existing devices also check resource end

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/of/base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 8383549..ef97a15 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -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;
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux