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:
Jean Delvare committed 2007-08-16 09:56:07 +00:00
1 parent b52225ffc0
commit 8896ba3b1f
5 files changed
+8 -11

No files matched your search

+1 -1
View File
@@ -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 */ /* 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); featureptr->data.name);
if ((f = fopen(path, "r"))) { if ((f = fopen(path, "r"))) {
-3
View File
@@ -78,9 +78,6 @@ int sensors_parse_chip_name(const char *orig_name, sensors_chip_name *res)
char *name = strdup(orig_name); char *name = strdup(orig_name);
int i; int i;
/* Play it safe */
res->busname = NULL;
if (! name) if (! name)
sensors_fatal_error("sensors_parse_chip_name","Allocating new name"); sensors_fatal_error("sensors_parse_chip_name","Allocating new name");
/* First split name in upto four pieces. */ /* First split name in upto four pieces. */
+1 -1
View File
@@ -90,7 +90,7 @@ void sensors_cleanup(void)
void free_chip_name(sensors_chip_name *name) void free_chip_name(sensors_chip_name *name)
{ {
free(name->prefix); free(name->prefix);
free(name->busname); free(name->path);
} }
void free_chip_features(sensors_chip_feature *features) void free_chip_features(sensors_chip_feature *features)
+1 -1
View File
@@ -43,7 +43,7 @@ typedef struct sensors_chip_name {
char *prefix; char *prefix;
int bus; int bus;
int addr; int addr;
char *busname; char *path;
} sensors_chip_name; } sensors_chip_name;
/* (Re)load the configuration file and the detected chips list. If this /* (Re)load the configuration file and the detected chips list. If this
+5 -5
View File
@@ -222,8 +222,8 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
if (!entry.chip.prefix) if (!entry.chip.prefix)
sensors_fatal_error(__FUNCTION__, "out of memory"); sensors_fatal_error(__FUNCTION__, "out of memory");
entry.chip.busname = strdup(dev->path); entry.chip.path = strdup(dev->path);
if (!entry.chip.busname) if (!entry.chip.path)
sensors_fatal_error(__FUNCTION__, "out of memory"); sensors_fatal_error(__FUNCTION__, "out of memory");
if (sscanf(dev->name, "%d-%x", &entry.chip.bus, &entry.chip.addr) == 2) { 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: exit_free:
free(entry.chip.prefix); free(entry.chip.prefix);
free(entry.chip.busname); free(entry.chip.path);
return err; 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) || sscanf(the_feature->data.name, "temp%d%c", &dummy, &check) == 1)
suffix = "_input"; 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); suffix);
if ((f = fopen(n, "r"))) { if ((f = fopen(n, "r"))) {
int res = fscanf(f, "%lf", value); 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) || sscanf(the_feature->data.name, "temp%d%c", &dummy, &check) == 1)
suffix = "_input"; 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); suffix);
if ((f = fopen(n, "w"))) { if ((f = fopen(n, "w"))) {
for (mag = the_feature->scaling; mag > 0; mag --) for (mag = the_feature->scaling; mag > 0; mag --)