lkml.org 
[lkml]   [2014]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2 2/7] opp: handle of_node_{get|put}() inside of_init_opp_table()
Date
All callers of of_init_opp_table() are required to call of_node_{get|put}()
before and after calling it. It would be better if this can be handled within
of_init_opp_table().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/base/power/opp.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index faae9cf..2b615b9 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -622,6 +622,9 @@ int of_init_opp_table(struct device *dev)
const __be32 *val;
int nr;

+ if (!of_node_get(dev->of_node))
+ return -ENODEV;
+
prop = of_find_property(dev->of_node, "operating-points", NULL);
if (!prop)
return -ENODEV;
@@ -649,6 +652,7 @@ int of_init_opp_table(struct device *dev)
nr -= 2;
}

+ of_node_put(dev->of_node);
return 0;
}
EXPORT_SYMBOL_GPL(of_init_opp_table);
--
2.0.0.rc2


\
 
 \ /
  Last update: 2014-05-21 13:41    [W:0.145 / U:1.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site