diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2016-02-22 11:05:51 +0000 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2016-02-22 11:05:51 +0000 |
commit | 1eedd480214d97dd80defc19b0849ea45cd692ef (patch) | |
tree | 1fc17e88ec55215d133f622505ae07b2575cb4ea | |
parent | 627d28d60f885fed586695f2837b097026afd883 (diff) |
Revert "display error on module window"
This reverts commit 96f6e050107da5d258280b785e5ed410d534a775.
Conflicts:
gpio.c
regulator.c
sensor.c
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r-- | display.c | 9 | ||||
-rw-r--r-- | display.h | 1 | ||||
-rw-r--r-- | gpio.c | 17 | ||||
-rw-r--r-- | regulator.c | 18 | ||||
-rw-r--r-- | sensor.c | 18 |
5 files changed, 3 insertions, 60 deletions
@@ -279,15 +279,6 @@ int display_reset_cursor(int win) return wmove(windata[win].pad, 0, 0); } -void display_message(int win, char *buf) -{ - display_reset_cursor(win); - wattron(windata[win].pad, WA_BOLD); - wprintw(windata[win].pad, "%s\n", buf); - wattroff(windata[win].pad, WA_BOLD); - display_refresh_pad(win); -} - int display_print_line(int win, int line, char *str, int bold, void *data) { int attr = 0; @@ -33,7 +33,6 @@ struct powerdebug_options; extern int display_print_line(int window, int line, char *str, int bold, void *data); -extern void display_message(int window, char *buf); extern int display_refresh_pad(int window); extern int display_reset_cursor(int window); @@ -51,7 +51,6 @@ struct gpio_info { } *gpios_info; static struct tree *gpio_tree = NULL; -static bool gpio_error = false; static struct gpio_info *gpio_alloc(void) { @@ -265,11 +264,6 @@ static int gpio_print_info(struct tree *tree) static int gpio_display(bool refresh) { - if (gpio_error) { - display_message(GPIO, "error: path " SYSFS_GPIO " not found"); - return -2; - } - if (refresh && read_gpio_info(gpio_tree)) return -1; @@ -377,18 +371,9 @@ out: */ int gpio_init(struct powerdebug_options *options) { - int ret = 0; - if (!(options->flags & GPIO_OPTION)) return 0; - ret = display_register(GPIO, &gpio_ops); - if (ret) - printf("error: gpio display register failed"); - - if (access(SYSFS_GPIO, F_OK)) - gpio_error = true; /* set the flag */ - export_free_gpios(); gpio_tree = tree_load(SYSFS_GPIO, gpio_filter_cb, false); @@ -398,5 +383,5 @@ int gpio_init(struct powerdebug_options *options) if (fill_gpio_tree()) return -1; - return ret; + return display_register(GPIO, &gpio_ops); } diff --git a/regulator.c b/regulator.c index 549a744..1f7aefd 100644 --- a/regulator.c +++ b/regulator.c @@ -73,7 +73,6 @@ static struct regulator_data regdata[] = { }; static struct tree *reg_tree; -static bool regulator_error = false; static struct regulator_info *regulator_alloc(void) { @@ -226,12 +225,6 @@ static int regulator_print_info(struct tree *tree) static int regulator_display(bool refresh) { - if (regulator_error) { - display_message(REGULATOR, - "error: path " SYSFS_REGULATOR " not found"); - return -2; - } - if (refresh && read_regulator_info(reg_tree)) return -1; @@ -267,18 +260,9 @@ static struct display_ops regulator_ops = { int regulator_init(struct powerdebug_options *options) { - int ret = 0; - if (!(options->flags & REGULATOR_OPTION)) return 0; - ret = display_register(REGULATOR, ®ulator_ops); - if (ret) - printf("error: regulator display register failed"); - - if (access(SYSFS_REGULATOR, F_OK)) - regulator_error = true; /* set the flag */ - reg_tree = tree_load(SYSFS_REGULATOR, regulator_filter_cb, false); if (!reg_tree) return -1; @@ -286,5 +270,5 @@ int regulator_init(struct powerdebug_options *options) if (fill_regulator_tree()) return -1; - return ret; + return display_register(REGULATOR, ®ulator_ops); } @@ -37,7 +37,6 @@ #define SYSFS_SENSOR "/sys/class/hwmon" static struct tree *sensor_tree; -static bool sensor_error = false; struct temp_info { char name[NAME_MAX]; @@ -279,12 +278,6 @@ static int sensor_print_info(struct tree *tree) static int sensor_display(bool refresh) { - if (sensor_error) { - display_message(SENSOR, - "error: path " SYSFS_SENSOR " not found"); - return -2; - } - if (refresh && read_sensor_info(sensor_tree)) return -1; @@ -297,18 +290,9 @@ static struct display_ops sensor_ops = { int sensor_init(struct powerdebug_options *options) { - int ret = 0; - if (!(options->flags & SENSOR_OPTION)) return 0; - ret = display_register(SENSOR, &sensor_ops); - if (ret) - printf("error: sensor display register failed"); - - if (access(SYSFS_SENSOR, F_OK)) - sensor_error = true; /* set the flag */ - sensor_tree = tree_load(SYSFS_SENSOR, sensor_filter_cb, false); if (!sensor_tree) return -1; @@ -316,5 +300,5 @@ int sensor_init(struct powerdebug_options *options) if (fill_sensor_tree()) return -1; - return ret; + return display_register(SENSOR, &sensor_ops); } |