aboutsummaryrefslogtreecommitdiff
path: root/clocks.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2011-06-27 22:59:17 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2011-06-27 22:59:17 +0200
commitcaafece2b452cbcb7f41672a3b4b76d64392e6da (patch)
treeea304adc8e2bbd189e7b8253fc987ca434e146ff /clocks.c
parent8f8050792fa4040615bcdac2aaae7e81f7122769 (diff)
fix segfault when no clock is available
When there is no clock available, we even register the display ops. The 'enter' callbakc is set but not data is available int the row private data which leads to a segfaults. This patch fix this problem by not registering the ops if the pm subsystem was not correctly initialized. In the meantime, we have to erase the window when we are switching from one window to another. We can say it is the "default" display callback. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reported-by: Milo (Woogyom) Kim <woogyom.kim@gmail.com>
Diffstat (limited to 'clocks.c')
-rw-r--r--clocks.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/clocks.c b/clocks.c
index 0bd0a0e..20a245c 100644
--- a/clocks.c
+++ b/clocks.c
@@ -405,9 +405,6 @@ int clock_init(void)
{
char clk_dir_path[PATH_MAX];
- if (display_register(CLOCK, &clock_ops))
- return -1;
-
if (locate_debugfs(clk_dir_path))
return -1;
@@ -420,5 +417,8 @@ int clock_init(void)
if (!clock_tree)
return -1;
- return fill_clock_tree();
+ if (fill_clock_tree())
+ return -1;
+
+ return display_register(CLOCK, &clock_ops);
}