2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

Rename sensors_feature_data.mode to flags, as we plan to use it to

store non-mode flags soon.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4757 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2007-09-05 08:13:15 +00:00
parent 079ba26574
commit 87efbc06c5
7 changed files with 11 additions and 11 deletions

View File

@@ -238,7 +238,7 @@ int sensors_get_value(const sensors_chip_name *name, int feature,
alt_feature = sensors_lookup_feature_nr(name,
main_feature->data.compute_mapping);
if (!(main_feature->data.mode & SENSORS_MODE_R))
if (!(main_feature->data.flags & SENSORS_MODE_R))
return -SENSORS_ERR_ACCESS_R;
for (chip = NULL;
!expr && (chip = sensors_for_all_config_chips(name, chip));)
@@ -285,7 +285,7 @@ int sensors_set_value(const sensors_chip_name *name, int feature,
alt_feature = sensors_lookup_feature_nr(name,
main_feature->data.compute_mapping);
if (!(main_feature->data.mode & SENSORS_MODE_W))
if (!(main_feature->data.flags & SENSORS_MODE_W))
return -SENSORS_ERR_ACCESS_W;
for (chip = NULL;
!expr && (chip = sensors_for_all_config_chips(name, chip));)

View File

@@ -132,7 +132,7 @@ typedef struct sensors_bus {
compute_mapping is like logical_mapping, only it refers to another
feature whose compute line will be inherited (a group could be fan and
fan_max, but not fan_div)
mode is a bitfield, its value is a combination of SENSORS_MODE_R (readable)
flags is a bitfield, its value is a combination of SENSORS_MODE_R (readable)
and SENSORS_MODE_W (writable).
scaling is the number of decimal points to scale by.
Divide the read value by 10**scaling to get the real value. */

View File

@@ -115,11 +115,11 @@ This structure is used when you want to get all features of a specific chip.
.br
int compute_mapping;
.br
int mode;
unsigned int flags;
.br
} sensors_feature_data;\fP
.br
The mode field is a bitfield, its value is a combination of
The flags field is a bitfield, its value is a combination of
SENSORS_MODE_R (readable) and SENSORS_MODE_W (writable).
\fBconst sensors_feature_data *sensors_get_all_features

View File

@@ -112,7 +112,7 @@ int sensors_do_chip_sets(const sensors_chip_name *name);
const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
*match, int *nr);
/* These defines are used in the mode field of sensors_feature_data */
/* These defines are used in the flags field of sensors_feature_data */
#define SENSORS_MODE_R 1
#define SENSORS_MODE_W 2
@@ -164,7 +164,7 @@ typedef struct sensors_feature_data {
sensors_feature_type type;
int mapping;
int compute_mapping;
int mode;
unsigned int flags;
} sensors_feature_data;
/* This returns all features of a specific chip. They are returned in

View File

@@ -153,9 +153,9 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip,
}
if (attr->method & SYSFS_METHOD_SHOW)
feature.data.mode |= SENSORS_MODE_R;
feature.data.flags |= SENSORS_MODE_R;
if (attr->method & SYSFS_METHOD_STORE)
feature.data.mode |= SENSORS_MODE_W;
feature.data.flags |= SENSORS_MODE_W;
feature.scaling = get_type_scaling(type);

View File

@@ -88,7 +88,7 @@ readUnknownChip
if (!(label = sensors_get_label (chip, sensor->number))) {
sensorLog (LOG_ERR, "Error getting sensor label: %s/%s", chip->prefix, sensor->name);
ret = 21;
} else if (!(sensor->mode & SENSORS_MODE_R)) {
} else if (!(sensor->flags & SENSORS_MODE_R)) {
sensorLog (LOG_INFO, "%s: %s", sensor->name, label);
} else if ((ret = sensors_get_value (chip, sensor->number, &value))) {
sensorLog (LOG_ERR, "Error getting sensor data: %s/%s: %s", chip->prefix, sensor->name, sensors_strerror (ret));

View File

@@ -41,7 +41,7 @@ void print_chip_raw(const sensors_chip_name *name)
data->name);
continue;
}
if (data->mode & SENSORS_MODE_R) {
if (data->flags & SENSORS_MODE_R) {
if (sensors_get_value(name, data->number, &val))
printf("ERROR: Can't get feature `%s' data!\n",
data->name);