mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-02 14:33:20 +07:00
Rename sensors_chip_name.busname to path, as this is what we are using
it for by now. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4673 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
+1
-1
@@ -170,7 +170,7 @@ int sensors_get_label(const sensors_chip_name *name, int feature, char **result)
|
||||
}
|
||||
|
||||
/* No user specified label, check for a _label sysfs file */
|
||||
snprintf(path, PATH_MAX, "%s/%s_label", name->busname,
|
||||
snprintf(path, PATH_MAX, "%s/%s_label", name->path,
|
||||
featureptr->data.name);
|
||||
|
||||
if ((f = fopen(path, "r"))) {
|
||||
|
||||
@@ -78,9 +78,6 @@ int sensors_parse_chip_name(const char *orig_name, sensors_chip_name *res)
|
||||
char *name = strdup(orig_name);
|
||||
int i;
|
||||
|
||||
/* Play it safe */
|
||||
res->busname = NULL;
|
||||
|
||||
if (! name)
|
||||
sensors_fatal_error("sensors_parse_chip_name","Allocating new name");
|
||||
/* First split name in upto four pieces. */
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ void sensors_cleanup(void)
|
||||
void free_chip_name(sensors_chip_name *name)
|
||||
{
|
||||
free(name->prefix);
|
||||
free(name->busname);
|
||||
free(name->path);
|
||||
}
|
||||
|
||||
void free_chip_features(sensors_chip_feature *features)
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ typedef struct sensors_chip_name {
|
||||
char *prefix;
|
||||
int bus;
|
||||
int addr;
|
||||
char *busname;
|
||||
char *path;
|
||||
} sensors_chip_name;
|
||||
|
||||
/* (Re)load the configuration file and the detected chips list. If this
|
||||
|
||||
+5
-5
@@ -222,8 +222,8 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
|
||||
if (!entry.chip.prefix)
|
||||
sensors_fatal_error(__FUNCTION__, "out of memory");
|
||||
|
||||
entry.chip.busname = strdup(dev->path);
|
||||
if (!entry.chip.busname)
|
||||
entry.chip.path = strdup(dev->path);
|
||||
if (!entry.chip.path)
|
||||
sensors_fatal_error(__FUNCTION__, "out of memory");
|
||||
|
||||
if (sscanf(dev->name, "%d-%x", &entry.chip.bus, &entry.chip.addr) == 2) {
|
||||
@@ -270,7 +270,7 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
|
||||
|
||||
exit_free:
|
||||
free(entry.chip.prefix);
|
||||
free(entry.chip.busname);
|
||||
free(entry.chip.path);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ int sensors_read_sysfs_attr(const sensors_chip_name *name, int feature,
|
||||
|| sscanf(the_feature->data.name, "temp%d%c", &dummy, &check) == 1)
|
||||
suffix = "_input";
|
||||
|
||||
snprintf(n, NAME_MAX, "%s/%s%s", name->busname, the_feature->data.name,
|
||||
snprintf(n, NAME_MAX, "%s/%s%s", name->path, the_feature->data.name,
|
||||
suffix);
|
||||
if ((f = fopen(n, "r"))) {
|
||||
int res = fscanf(f, "%lf", value);
|
||||
@@ -451,7 +451,7 @@ int sensors_write_sysfs_attr(const sensors_chip_name *name, int feature,
|
||||
|| sscanf(the_feature->data.name, "temp%d%c", &dummy, &check) == 1)
|
||||
suffix = "_input";
|
||||
|
||||
snprintf(n, NAME_MAX, "%s/%s%s", name->busname, the_feature->data.name,
|
||||
snprintf(n, NAME_MAX, "%s/%s%s", name->path, the_feature->data.name,
|
||||
suffix);
|
||||
if ((f = fopen(n, "w"))) {
|
||||
for (mag = the_feature->scaling; mag > 0; mag --)
|
||||
|
||||
Reference in New Issue
Block a user