Changeset 3076

Show
Ignore:
Timestamp:
09/10/05 11:29:35 (8 years ago)
Author:
khali
Message:

Fix bus matching mechanism which had always been broken for Linux
2.6. Original patch from Karsten Petersen.

Files:
1 modified

Legend:

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

    r2537 r3076  
    227227  } 
    228228 
     229  /* We used to compare both the adapter and the algorithm names for 
     230     bus matching, but Linux 2.6 has no more names for algorithms, and 
     231     it was redundant anyway. So we now only rely on the adapter name. */ 
    229232  for (j = 0; j < sensors_proc_bus_count; j++) { 
    230233    if (!strcmp(sensors_config_busses[i].adapter, 
    231                 sensors_proc_bus[j].adapter) && 
    232         !strcmp(sensors_config_busses[i].algorithm, 
    233                 sensors_proc_bus[j].algorithm))  
    234       break; 
    235   } 
    236  
    237   /* Well, if we did not find anything, j = sensors_proc_bus_count; so if 
    238      we set this chip's bus number to j, it will never be matched. Good. */ 
    239   name->bus = j; 
     234                sensors_proc_bus[j].adapter)) { 
     235      name->bus = sensors_proc_bus[j].number; 
     236      return 0; 
     237    } 
     238  } 
     239 
     240  /* We did not find anything. sensors_proc_bus_count is not a valid 
     241     bus number, so it will never be matched. Good. */ 
     242  name->bus = sensors_proc_bus_count; 
    240243  return 0; 
    241244}