linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: fix of_update_property()
@ 2014-01-17  4:46 Xiubo Li
       [not found] ` < CAL_JsqJuAv8=pBuzYO5ZGzroD1kq6gjmNsTjoVyXR=vcu+-pTA@mail.gmail.com>
  2014-01-17 14:49 ` Rob Herring
  0 siblings, 2 replies; 5+ messages in thread
From: Xiubo Li @ 2014-01-17  4:46 UTC (permalink / raw)
  To: grant.likely, robh+dt; +Cc: devicetree, linux-kernel, Xiubo Li

The of_update_property() is intent to update a property in a node
and if the property does not exist, will add it to the node.

The second search of the property is possibly won't be found, that
maybe removed by other thread just before the second search begain,
if so just retry it.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 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 f807d0e..d0c53bc 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1572,6 +1572,7 @@ int of_update_property(struct device_node *np, struct property *newprop)
 	if (!newprop->name)
 		return -EINVAL;
 
+retry:
 	oldprop = of_find_property(np, newprop->name, NULL);
 	if (!oldprop)
 		return of_add_property(np, newprop);
@@ -1593,7 +1594,7 @@ int of_update_property(struct device_node *np, struct property *newprop)
 	raw_spin_unlock_irqrestore(&devtree_lock, flags);
 
 	if (!found)
-		return -ENODEV;
+		goto retry;
 
 #ifdef CONFIG_PROC_DEVICETREE
 	/* try to add to proc as well if it was initialized */
-- 
1.8.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-04 17:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-17  4:46 [PATCH] of: fix of_update_property() Xiubo Li
     [not found] ` < CAL_JsqJuAv8=pBuzYO5ZGzroD1kq6gjmNsTjoVyXR=vcu+-pTA@mail.gmail.com>
2014-01-17 14:49 ` Rob Herring
2014-01-17 16:42   ` Pantelis Antoniou
2014-01-20  5:50   ` Li.Xiubo
2014-02-04 17:26     ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).