ignore disabled memory-region nodes
PATCH 1/1 ignore disabled memory-region nodes
While parsing "memory-region" node lists if a node is "disabled", parsing halts. Therefore the nodes whoes "status" is "okay" or "ok" are not parsed.
The change ignore disabled nodes in the memory-region nodes list and continues to initialize the rest of enabled nodes.
Krishna Reddy (1):
of: resered-memory: ignore disabled memory-region nodes
drivers/of/of_reserved_mem.c | 5 +++++ 1 file changed, 5 insertions(+)
Signature · 1 line
2.7.4
PATCH 1/1 of: resered-memory: ignore disabled memory-region nodes
From: Krishna Reddy <[email protected]>
Ignore disabled nodes in the memory-region nodes list and continue to initialize the rest of enabled nodes.
--- drivers/of/of_reserved_mem.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/of/of_reserved_mem.c +5 -0
@@ -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);
Signature · 1 line
2.7.4
Re: [PATCH] of: resered-memory: ignore disabled memory-region nodes
Quoted 23 lines · Puneet Saxena
From: Krishna Reddy <[email protected]>
Ignore disabled nodes in the memory-region nodes list and continue to initialize the rest of enabled nodes.
Signed-off-by Krishna Reddy <[email protected]>--- drivers/of/of_reserved_mem.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/of/of_reserved_mem.c +1
-0@@ -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 ;
drivers/of/of_reserved_mem.c int of_reserved_mem_device_init_by_idx(struct device *dev, · line 329
Quoted 7 lines
drivers/of/of_reserved_mem.c +4
-0@@ -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 ; +
Does of_device_is_available() not work? Other than that, looks fine to me.
Thierry
Re: [PATCH] of: resered-memory: ignore disabled memory-region nodes
Yes, of_device_is_available() will work here. Will incorporate in next PS.
Thanks.
Quoted 27 lines · Thierry Reding
Quoted 26 lines · Puneet Saxena
From: Krishna Reddy <[email protected]>
Ignore disabled nodes in the memory-region nodes list and continue to initialize the rest of enabled nodes.
Signed-off-by Krishna Reddy <[email protected]>--- drivers/of/of_reserved_mem.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/of/of_reserved_mem.c +1
-0@@ -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 ;
Quoted 8 lines
drivers/of/of_reserved_mem.c int of_reserved_mem_device_init_by_idx(struct device *dev, · line 329
Quoted 4 lines
drivers/of/of_reserved_mem.c +4
-0+ status =of_get_property (target,"status" ,NULL ); +if (status &&strcmp (status,"okay" ) !=0 &&strcmp (status,"ok" ) !=0 ) +return 0 ; +Does
of_device_is_available()not work? Other than that, looks fine to me.Thierry
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------