Changeset 4208

Show
Ignore:
Timestamp:
10/13/06 21:55:41 (8 years ago)
Author:
khali
Message:

libsensors: Drop support for algorithm names.
I2C algorithms no longer have names in Linux 2.6, and anyway they are
implementation details user-space doesn't care about. No third party
application is known to have ever used this particular feature of
libsensors. "sensord" and "sensors" no longer do.

Location:
lm-sensors/trunk
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4206 r4208  
    55  Library: Add support for the pc87247 driver (fans only) 
    66           Probe for busses before chips 
     7           Drop support for algorithm names 
    78  Man page sensors.1: Update (option -c) and clean up 
    89  Module icspll: Delete. It was useless and dangerous. 
  • lm-sensors/trunk/lib/access.c

    r4098 r4208  
    318318} 
    319319 
     320/* This function is deprecated and will be dropped soon. */ 
    320321const char *sensors_get_algorithm_name(int bus_nr) 
    321322{ 
    322         int i; 
    323  
    324         if (bus_nr == SENSORS_CHIP_NAME_BUS_ISA) 
    325                 return "ISA algorithm"; 
    326         if (bus_nr == SENSORS_CHIP_NAME_BUS_PCI) 
    327                 return "PCI algorithm"; 
    328         if (bus_nr == SENSORS_CHIP_NAME_BUS_DUMMY) 
    329                 return "Dummy algorithm"; 
    330         for (i = 0; i < sensors_proc_bus_count; i++) 
    331                 if (sensors_proc_bus[i].number == bus_nr) 
    332                         return sensors_proc_bus[i].algorithm; 
    333         return NULL; 
     323        return "No longer available"; 
    334324} 
    335325 
  • lm-sensors/trunk/lib/conf-parse.y

    r2345 r4208  
    135135 
    136136line:     bus_statement EOL 
     137        | busalgo_statement EOL 
    137138        | label_statement EOL 
    138139        | set_statement EOL 
     
    143144; 
    144145 
    145 bus_statement:    BUS i2cbus_name adapter_name algorithm_name 
     146bus_statement:    BUS i2cbus_name adapter_name 
    146147                  { sensors_bus new_el; 
    147148                    new_el.lineno = $1; 
    148149                    new_el.number = $2; 
    149150                    new_el.adapter = $3; 
    150                     new_el.algorithm = $4; 
    151151                    bus_add_el(&new_el); 
    152152                  } 
     153; 
     154 
     155/* for compatibility, deprecated */ 
     156busalgo_statement:        BUS i2cbus_name adapter_name algorithm_name 
     157                          { sensors_bus new_el; 
     158                            new_el.lineno = $1; 
     159                            new_el.number = $2; 
     160                            new_el.adapter = $3; 
     161                            free($4); 
     162                            bus_add_el(&new_el); 
     163                          } 
    153164; 
    154165 
  • lm-sensors/trunk/lib/data.h

    r3091 r4208  
    112112 
    113113/* Config file bus declaration: the i2c bus number, combined with adapter 
    114    and algorithm names */ 
     114   name */ 
    115115typedef struct sensors_bus { 
    116116  int number; 
    117117  char *adapter; 
    118   char *algorithm; 
    119118  int lineno; 
    120119} sensors_bus; 
  • lm-sensors/trunk/lib/init.c

    r4198 r4208  
    104104{ 
    105105  free(bus.adapter); 
    106   free(bus.algorithm); 
    107106} 
    108107 
  • lm-sensors/trunk/lib/libsensors.3

    r4157 r4208  
    2525.\" References consulted: 
    2626.\"     libsensors source code 
    27 .TH libsensors 3  "December 30, 1998" "" "Linux Programmer's Manual" 
     27.TH libsensors 3  "October 2006" "" "Linux Programmer's Manual" 
    2828.SH NAME 
    29 libsensors \- publically accessible functions provided by the sensors library 
     29libsensors \- publicly accessible functions provided by the sensors library 
    3030.SH SYNOPSIS 
    3131.nf 
     
    4040.B int sensors_chip_name_has_wildcards(sensors_chip_name chip); 
    4141.B const char *sensors_get_adapter_name(int bus_nr); 
    42 .B const char *sensors_get_algorithm_name(int bus_nr); 
    4342.B int sensors_get_label(sensors_chip_name name, int feature,  
    4443                      \fBchar **result);\fP 
     
    8079.B const char *sensors_get_adapter_name(int bus_nr); 
    8180.br 
     81This function returns the adapter name of a bus number, as used within the 
     82sensors_chip_name structure. If it could not be found, it returns NULL. 
     83 
    8284.B const char *sensors_get_algorithm_name(int bus_nr); 
    8385.br 
    84 These functions return the adapter and algorithm names of a bus number, as used within the sensors_chip_name structure. If it could not be found, it returns NULL 
     86This function used to return the algorithm name of a bus number. 
     87It is now deprecated and returns an arbitrary string. It will be dropped 
     88in a later version of the library so you should stop using it. 
    8589 
    8690\fBint sensors_get_label(sensors_chip_name name, int feature, 
  • lm-sensors/trunk/lib/proc.c

    r4081 r4208  
    9595    if (! (border = rindex(line,'\t'))) 
    9696      goto ERROR; 
    97     if (! (entry.algorithm = strdup(border+1))) 
    98       goto FAT_ERROR; 
     97    /* Skip algorithm name */ 
    9998    *border='\0'; 
    10099    if (! (border = rindex(line,'\t'))) 
     
    110109    if (sensors_parse_i2cbus_name(line,&entry.number)) 
    111110      goto ERROR; 
    112     sensors_strip_of_spaces(entry.algorithm); 
    113111    sensors_strip_of_spaces(entry.adapter); 
    114112    sensors_add_proc_bus(&entry); 
  • lm-sensors/trunk/lib/sensors.conf.5

    r4157 r4208  
    2424.\" References consulted: 
    2525.\"     sensors.conf.eg by Frodo Looijaard 
    26 .TH sensors.conf 5  "February 8, 1999" "" "Linux Programmer's Manual" 
     26.TH sensors.conf 5  "October 2006" "" "Linux Programmer's Manual" 
    2727.SH NAME 
    2828sensors.conf \- libsensors configuration file 
     
    125125 
    126126.RS 
    127 bus "i2c\-0" "SMBus PIIX4 adapter at e800" "Non\-I2C SMBus adapter" 
     127bus "i2c\-0" "SMBus PIIX4 adapter at e800" 
    128128.RE 
    129129 
     
    140140always be quoted. 
    141141 
    142 The second and third arguments are the  
    143 description texts. They must be exactly match the texts as they appear in 
    144 .IR /proc/bus/i2c , 
    145 except for trailing spaces, which are removed both from the /proc 
    146 entries and the arguments. The adapter description comes first, followed 
    147 by the algorithm description. 
     142The second argument is the adapter name, it must match exactly the 
     143adapter name as it appears in 
     144.I /proc/bus/i2c 
     145(2.4 kernel) 
     146or 
     147.I /sys/class/i2c-adapter/i2c-*/device/name 
     148(2.6 kernel). 
     149It should always be quoted as well as it will most certainly contain 
     150spaces or dashes. 
     151 
     152There used to be a third argument, the algorithm name. For compatibility 
     153reasons, the parser still accepts this third argument, but ignores it. 
    148154 
    149155The 
  • lm-sensors/trunk/lib/sensors.h

    r4098 r4208  
    6969extern int sensors_chip_name_has_wildcards(sensors_chip_name chip); 
    7070 
    71 /* These functions return the adapter and algorithm names of a bus number, 
     71/* This function returns the adapter name of a bus number, 
    7272   as used within the sensors_chip_name structure. If it could not be found,  
    7373   it returns NULL */ 
    7474extern const char *sensors_get_adapter_name(int bus_nr); 
     75 
     76/* This function is deprecated and will be dropped soon. */ 
    7577extern const char *sensors_get_algorithm_name(int bus_nr); 
    7678 
  • lm-sensors/trunk/lib/sysfs.c

    r4159 r4208  
    208208                if (!strncmp(entry.adapter, "ISA ", 4)) { 
    209209                        entry.number = SENSORS_CHIP_NAME_BUS_ISA; 
    210                         entry.algorithm = strdup("ISA bus algorithm"); 
    211210                } else if (sscanf(clsdev->name, "i2c-%d", &entry.number) != 1) { 
    212211                        entry.number = SENSORS_CHIP_NAME_BUS_DUMMY; 
    213                         entry.algorithm = strdup("Dummy bus algorithm"); 
    214                 } else 
    215                         entry.algorithm = strdup("Unavailable from sysfs"); 
    216  
    217                 if (!entry.algorithm) 
    218                         sensors_fatal_error(__FUNCTION__, "out of memory"); 
     212                } 
    219213 
    220214                sensors_add_proc_bus(&entry);