[PATCH] of: resered-memory: ignore disabled memory-region nodes

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

 



From: Krishna Reddy <vdumpa@xxxxxxxxxx>

Ignore disabled nodes in the memory-region nodes list and continue
to initialize the rest of enabled nodes.

Signed-off-by: Krishna Reddy <vdumpa@xxxxxxxxxx>
---
 drivers/of/of_reserved_mem.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 1977ee0adcb1..58d95d774e3b 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -314,6 +314,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
 	struct device_node *target;
 	struct reserved_mem *rmem;
 	int ret;
+	const char *status;
 
 	if (!np || !dev)
 		return -EINVAL;
@@ -322,6 +323,10 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
 	if (!target)
 		return -ENODEV;
 
+	status = of_get_property(target, "status", NULL);
+	if (status && strcmp(status, "okay") != 0 && strcmp(status, "ok") != 0)
+		return 0;
+
 	rmem = __find_rmem(target);
 	of_node_put(target);
 
-- 
2.7.4




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux