From 6c229f7a3c35649fa0432d582282ca2c95c754b6 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 24 Sep 2007 16:34:56 +0000 Subject: [PATCH] Drop SENSORS_ERR_NO_DEVS: we return success, not error, when no device is found. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4879 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/error.c | 3 +-- lib/error.h | 3 +-- lib/sysfs.c | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/error.c b/lib/error.c index ab104e96..cf3fa9a7 100644 --- a/lib/error.c +++ b/lib/error.c @@ -35,14 +35,13 @@ static const char *errorlist[] = { /* Invalid error code */ NULL, /* SENSORS_ERR_WILDCARDS */ "Wildcard found in chip name", /* SENSORS_ERR_NO_ENTRY */ "No such subfeature known", - /* SENSORS_ERR_NO_DEVS */ "No devices found", + /* SENSORS_ERR_ACCESS_R */ "Can't read", /* SENSORS_ERR_KERNEL */ "Kernel interface error", /* SENSORS_ERR_DIV_ZERO */ "Divide by zero", /* SENSORS_ERR_CHIP_NAME */ "Can't parse chip name", /* SENSORS_ERR_BUS_NAME */ "Can't parse bus name", /* SENSORS_ERR_PARSE */ "General parse error", /* SENSORS_ERR_ACCESS_W */ "Can't write", - /* SENSORS_ERR_ACCESS_R */ "Can't read", }; const char *sensors_strerror(int errnum) diff --git a/lib/error.h b/lib/error.h index e9be52fb..66dd1294 100644 --- a/lib/error.h +++ b/lib/error.h @@ -23,14 +23,13 @@ #define SENSORS_ERR_WILDCARDS 1 /* Wildcard found in chip name */ #define SENSORS_ERR_NO_ENTRY 2 /* No such subfeature known */ -#define SENSORS_ERR_NO_DEVS 3 /* No devices found */ +#define SENSORS_ERR_ACCESS_R 3 /* Can't read */ #define SENSORS_ERR_KERNEL 4 /* Kernel interface error */ #define SENSORS_ERR_DIV_ZERO 5 /* Divide by zero */ #define SENSORS_ERR_CHIP_NAME 6 /* Can't parse chip name */ #define SENSORS_ERR_BUS_NAME 7 /* Can't parse bus name */ #define SENSORS_ERR_PARSE 8 /* General parse error */ #define SENSORS_ERR_ACCESS_W 9 /* Can't write */ -#define SENSORS_ERR_ACCESS_R 10 /* Can't read */ #ifdef __cplusplus extern "C" { diff --git a/lib/sysfs.c b/lib/sysfs.c index 2e5f3d52..8317a932 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -437,13 +437,13 @@ static int sensors_read_sysfs_chips_compat(void) if (!(bus = sysfs_open_bus("i2c"))) { if (errno && errno != ENOENT) - ret = -SENSORS_ERR_NO_DEVS; + ret = -SENSORS_ERR_KERNEL; goto exit0; } if (!(devs = sysfs_get_bus_devices(bus))) { if (errno && errno != ENOENT) - ret = -SENSORS_ERR_NO_DEVS; + ret = -SENSORS_ERR_KERNEL; goto exit1; } @@ -474,14 +474,14 @@ int sensors_read_sysfs_chips(void) if (!(clsdevs = sysfs_get_class_devices(cls))) { if (errno && errno != ENOENT) - ret = -SENSORS_ERR_NO_DEVS; + ret = -SENSORS_ERR_KERNEL; goto exit; } dlist_for_each_data(clsdevs, clsdev, struct sysfs_class_device) { struct sysfs_device *dev; if (!(dev = sysfs_get_classdev_device(clsdev))) { - ret = -SENSORS_ERR_NO_DEVS; + ret = -SENSORS_ERR_KERNEL; goto exit; } if ((ret = sensors_read_one_sysfs_chip(dev)))