Fix display error on screen
The previous patch was reverted and is replaced by this one.
Instead of dancing around with global flag telling if a subsys succeed
or not and write a error, let's try to initialize the subsystem each
time a display is requested and output an error occurs.
That makes the code a bit nicer and give the opportunity to fix the
problem at the system level (eg. mount debugfs) without restarting
powerdebug.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
diff --git a/display.c b/display.c
index 8f44334..e34d083 100644
--- a/display.c
+++ b/display.c
@@ -303,6 +303,15 @@
return 0;
}
+int display_print_error(int window, int line, char *str)
+{
+ display_reset_cursor(window);
+ display_print_line(window, line, str, 0, NULL);
+ display_refresh_pad(window);
+
+ return 0;
+}
+
static int display_find_keystroke(int fd, void *data);
struct find_data {