Changeset 4690

Show
Ignore:
Timestamp:
08/19/07 17:27:14 (7 years ago)
Author:
khali
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/lib/data.c

    r4679 r4690  
    226226 
    227227 
     228#define SENSORS_CHIP_NAME_BUS_IGNORE -42 
     229 
    228230int sensors_substitute_chip(sensors_chip_name *name,int lineno) 
    229231{ 
     
    235237  if (i == sensors_config_busses_count) { 
    236238    sensors_parse_error("Undeclared i2c bus referenced",lineno); 
    237     name->bus = sensors_proc_bus_count; 
     239    name->bus = SENSORS_CHIP_NAME_BUS_IGNORE; 
    238240    return -SENSORS_ERR_BUS_NAME; 
    239241  } 
     
    250252  } 
    251253 
    252   /* We did not find anything. sensors_proc_bus_count is not a valid 
    253      bus number, so it will never be matched. Good. */ 
    254   name->bus = sensors_proc_bus_count; 
     254  /* We did not find a matching bus name, simply ignore this chip 
     255     config entry. */ 
     256  name->bus = SENSORS_CHIP_NAME_BUS_IGNORE; 
    255257  return 0; 
    256258}