| 171 | | ChipDescriptor *descriptor; |
| 172 | | descriptor = generateChipDescriptor (chip); |
| 173 | | if (descriptor) { |
| 174 | | ret = doKnownChip (chip, descriptor, action); |
| 175 | | free (descriptor->features); |
| 176 | | free (descriptor); |
| 177 | | } |
| | 171 | int index0, chipindex = -1; |
| | 172 | for (index0 = 0; knownChips[index0].features; ++ index0) |
| | 173 | /* Trick: we compare addresses here. We know it works because both |
| | 174 | pointers were returned by sensors_get_detected_chips(), so they |
| | 175 | refer to libsensors internal structures, which do not move. */ |
| | 176 | if (knownChips[index0].name == chip) { |
| | 177 | chipindex = index0; |
| | 178 | break; |
| | 179 | } |
| | 180 | if (chipindex >= 0) |
| | 181 | ret = doKnownChip (chip, &knownChips[chipindex], action); |