aboutsummaryrefslogtreecommitdiff
path: root/clocks.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2011-06-08 23:30:00 +0200
committerDaniel Lezcano <daniel.lezcano@free.fr>2011-06-08 23:30:00 +0200
commitc193b6018c016260a3ac51d51285a2c02512218f (patch)
treeffd542cdeefd3acce0be78c6325fb2fc8b08b60c /clocks.c
parent1c25df9671dfcc987d547f29745d121670149cf5 (diff)
downloadpowerdebug-c193b6018c016260a3ac51d51285a2c02512218f.tar.gz
tree structure abstraction for directory hierarchies
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'clocks.c')
-rw-r--r--clocks.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clocks.c b/clocks.c
index ecc72ea..8a2dc97 100644
--- a/clocks.c
+++ b/clocks.c
@@ -19,6 +19,7 @@
#include "powerdebug.h"
#include "clocks.h"
+#include "tree.h"
#define MAX_LINES 120
@@ -41,6 +42,8 @@ struct clock_info {
struct clock_info **children;
} *clocks_info;
+static struct tree *clock_tree;
+
static int locate_debugfs(char *clk_path)
{
const char *mtab = "/proc/mounts";
@@ -73,6 +76,10 @@ int clock_init(void)
sprintf(clk_dir_path, "%s/clock", clk_dir_path);
+ clock_tree = tree_load(clk_dir_path, NULL);
+ if (!clock_tree)
+ return -1;
+
return access(clk_dir_path, F_OK);
}