Fix device scan when no i2c support exists or no i2c bus driver

is loaded.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3261 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2006-02-25 21:32:26 +00:00
1 parent 184cb1e3c7
commit 70bb3c495e
1 file changed
+5 -2
+5 -2
View File
@@ -22,6 +22,7 @@
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <sysfs/libsysfs.h>
#include "data.h"
#include "error.h"
@@ -171,12 +172,14 @@ int sensors_read_sysfs_bus(void)
int ret = 0;
if (!(cls = sysfs_open_class("i2c-adapter"))) {
ret = -SENSORS_ERR_PROC;
if (errno && errno != ENOENT)
ret = -SENSORS_ERR_PROC;
goto exit0;
}
if (!(clsdevs = sysfs_get_class_devices(cls))) {
ret = -SENSORS_ERR_PROC;
if (errno)
ret = -SENSORS_ERR_PROC;
goto exit1;
}