diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2011-06-08 23:30:00 +0200 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@free.fr> | 2011-06-08 23:30:00 +0200 |
commit | c193b6018c016260a3ac51d51285a2c02512218f (patch) | |
tree | ffd542cdeefd3acce0be78c6325fb2fc8b08b60c /clocks.c | |
parent | 1c25df9671dfcc987d547f29745d121670149cf5 (diff) | |
download | powerdebug-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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); } |