summaryrefslogtreecommitdiff
path: root/lib/init.c
diff options
context:
space:
mode:
authorMark M. Hoffman <mhoffman@lightlink.com>2005-09-18 20:37:42 +0000
committerMark M. Hoffman <mhoffman@lightlink.com>2005-09-18 20:37:42 +0000
commitc277761d1515cb514276bc0416a4c5b03a579f9f (patch)
tree3526dc5285620ddc1f457e8af3216bfe18d965c3 /lib/init.c
parent87fba1c487fc3f2cfad2a2a874ff2d4c4253c423 (diff)
downloadlm-sensors-git-c277761d1515cb514276bc0416a4c5b03a579f9f.tar.gz
(mmh)
This patch replaces the I2C bus enumeration (through sysfs) in lib/proc.c with a new function in lib/sysfs (using libsysfs). The patch also updates the init code accordingly. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3094 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'lib/init.c')
-rw-r--r--lib/init.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/init.c b/lib/init.c
index 0bcd0d8e..170dbde3 100644
--- a/lib/init.c
+++ b/lib/init.c
@@ -41,11 +41,15 @@ int sensors_init(FILE *input)
{
int res;
sensors_cleanup();
- sensors_init_sysfs();
if ((res = sensors_read_proc_chips()))
return res;
- if ((res = sensors_read_proc_bus()))
- return res;
+ if (sensors_init_sysfs()) {
+ if ((res = sensors_read_sysfs_bus()))
+ return res;
+ } else {
+ if ((res = sensors_read_proc_bus()))
+ return res;
+ }
sensors_yyin = input;
if ((res = sensors_yyparse()))
return -SENSORS_ERR_PARSE;