From f1cc941e29cd4566be47d6b2eac080bc29c2cc92 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 19 Aug 2007 15:05:52 +0000 Subject: [PATCH] Contrary to what the comment says, sensors_proc_bus_count may be a perfectly valid bus number. We need to use a different value for chip configuration entries we want to ignore. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4688 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/data.c | 8 ++++---- lib/sensors.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/data.c b/lib/data.c index 53996b2e..2bae021f 100644 --- a/lib/data.c +++ b/lib/data.c @@ -192,7 +192,7 @@ int sensors_substitute_chip(sensors_chip_name *name, int lineno) if (i == sensors_config_busses_count) { sensors_parse_error("Undeclared bus id referenced", lineno); - name->bus.nr = sensors_proc_bus_count; + name->bus.nr = SENSORS_BUS_NR_IGNORE; return -SENSORS_ERR_BUS_NAME; } @@ -205,9 +205,9 @@ int sensors_substitute_chip(sensors_chip_name *name, int lineno) } } - /* We did not find anything. sensors_proc_bus_count is not - a valid bus number, so it will never be matched. Good. */ - name->bus.nr = sensors_proc_bus_count; + /* We did not find a matching bus name, simply ignore this chip + config entry. */ + name->bus.nr = SENSORS_BUS_NR_IGNORE; return 0; } diff --git a/lib/sensors.h b/lib/sensors.h index dac78fd3..a2350cac 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -34,6 +34,7 @@ #define SENSORS_BUS_TYPE_ISA 1 #define SENSORS_BUS_TYPE_PCI 2 #define SENSORS_BUS_NR_ANY (-1) +#define SENSORS_BUS_NR_IGNORE (-2) #ifdef __cplusplus extern "C" {