aboutsummaryrefslogtreecommitdiff
path: root/clocks.c
diff options
context:
space:
mode:
authorAmit Arora <amit.arora@linaro.org>2010-11-16 11:28:57 +0530
committerAmit Arora <amit.arora@linaro.org>2010-11-16 11:28:57 +0530
commit04f977447f757695cc211811010e93c0c5633eb9 (patch)
tree386f2eb96af751fb465e529225572e32f920ca30 /clocks.c
parent3bc8c920b5fb4438ffff9d08b63979c82b84fbe9 (diff)
downloadpowerdebug-04f977447f757695cc211811010e93c0c5633eb9.tar.gz
If unable to read clock tree, inform user
Diffstat (limited to 'clocks.c')
-rw-r--r--clocks.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/clocks.c b/clocks.c
index 80ff835..c413694 100644
--- a/clocks.c
+++ b/clocks.c
@@ -21,27 +21,33 @@ static char clk_dir_path[PATH_MAX];
static char clk_name[NAME_MAX];
static int bold[MAX_LINES];
-void init_clock_details(void)
+int init_clock_details(void)
{
char *path = debugfs_locate_mpoint();
struct stat buf;
-
if (path)
strcpy(clk_dir_path, path);
else {
- fprintf(stderr, "powerdebug: Unable to locate debugfs mount"
- " point. Mount debugfs and try again..\n");
- exit(1);
+ create_selectedwindow();
+ sprintf(clock_lines[0], "Unable to locate debugfs mount point."
+ " Mount debugfs and try again..\n");
+ print_one_clock(0, clock_lines[0], 1, 0);
+ old_clock_line_no = 1;
+ return(1);
}
sprintf(clk_dir_path, "%s/clock", clk_dir_path);
strcpy(clk_dir_path, "/debug/clock"); // Hardcoded for testing..
if (stat(clk_dir_path, &buf)) {
- fprintf(stderr, "powerdebug: Unable to find clock tree"
- " information at %s. Exiting..\n", clk_dir_path);
- exit(1);
+ create_selectedwindow();
+ sprintf(clock_lines[0], "Unable to find clock tree"
+ " information at %s.\n", clk_dir_path);
+ print_one_clock(0, clock_lines[0], 1, 0);
+ old_clock_line_no = 1;
+ return(1);
}
strcpy(clk_name, "");
+ return(0);
}
int get_int_from(char *file)