diff options
Diffstat (limited to 'sensor.c')
-rw-r--r-- | sensor.c | 18 |
1 files changed, 1 insertions, 17 deletions
@@ -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); } |