Index: /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sensord.h
===================================================================
--- /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sensord.h	(revision 4825)
+++ /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sensord.h	(revision 4828)
@@ -96,6 +96,9 @@
 
 typedef struct {
+  const sensors_chip_name *name;
   FeatureDescriptor *features;
 } ChipDescriptor;
 
-extern ChipDescriptor * generateChipDescriptor (const sensors_chip_name *chip);
+extern ChipDescriptor * knownChips;
+extern int initKnownChips (void);
+extern void freeKnownChips (void);
Index: /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/chips.c
===================================================================
--- /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/chips.c	(revision 4827)
+++ /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/chips.c	(revision 4828)
@@ -333,10 +333,9 @@
 }
 
-/* Note that alarms and beeps are no longer (or not yet) supported */
-ChipDescriptor * generateChipDescriptor (const sensors_chip_name *chip)
+static
+FeatureDescriptor * generateChipFeatures (const sensors_chip_name *chip)
 {
 	int nr, count = 1;
 	const sensors_feature_data *sensor;
-	ChipDescriptor *descriptor;
 	FeatureDescriptor *features;
 
@@ -349,12 +348,7 @@
 
 	/* Allocate the memory we need */
-	descriptor = calloc(1, sizeof(ChipDescriptor));
 	features = calloc(count, sizeof(FeatureDescriptor));
-	if (!descriptor || !features) {
-		free(descriptor);
-		free(features);
+	if (!features)
 		return NULL;
-	}
-	descriptor->features = features;
 
 	/* Fill in the data structures */
@@ -388,4 +382,42 @@
 	}
 
-	return descriptor;
-}
+	return features;
+}
+
+ChipDescriptor * knownChips;
+
+int initKnownChips (void)
+{
+  int nr, count = 1;
+  const sensors_chip_name *name;
+
+  /* How many chips do we have? */
+  nr = 0;
+  while ((name = sensors_get_detected_chips(NULL, &nr)))
+    count++;
+
+  /* Allocate the memory we need */
+  knownChips = calloc(count, sizeof(ChipDescriptor));
+  if (!knownChips)
+    return 1;
+
+  /* Fill in the data structures */
+  count = 0;
+  nr = 0;
+  while ((name = sensors_get_detected_chips(NULL, &nr))) {
+    knownChips[count].name = name;
+    if ((knownChips[count].features = generateChipFeatures(name)))
+      count++;
+  }
+
+  return 0;
+}
+
+void freeKnownChips (void)
+{
+  int index0;
+
+  for (index0 = 0; knownChips[index0].features; index0++)
+    free (knownChips[index0].features);
+  free (knownChips);
+}
Index: /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/lib.c
===================================================================
--- /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/lib.c	(revision 4693)
+++ /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/lib.c	(revision 4828)
@@ -117,5 +117,9 @@
 loadLib
 (void) {
-  return loadConfig (0);
+  int ret;
+  ret = loadConfig (0);
+  if (!ret)
+    ret = initKnownChips ();
+  return ret;
 }
 
@@ -123,5 +127,10 @@
 reloadLib
 (void) {
-  return loadConfig (1);
+  int ret;
+  freeKnownChips ();
+  ret = loadConfig (1);
+  if (!ret)
+    ret = initKnownChips ();
+  return ret;
 }
 
@@ -129,4 +138,5 @@
 unloadLib
 (void) {
+  freeKnownChips ();
   sensors_cleanup ();
   return 0;  
Index: /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/rrd.c
===================================================================
--- /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/rrd.c	(revision 4817)
+++ /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/rrd.c	(revision 4828)
@@ -142,9 +142,16 @@
   for (j = 0; (ret == 0) && (j < numChipNames); ++ j) {
     while ((ret == 0) && ((chip = sensors_get_detected_chips (&chipNames[j], &i)) != NULL)) {
-      ChipDescriptor *descriptor;
-      descriptor = generateChipDescriptor (chip);
-      if (descriptor) {
+      int index0, chipindex = -1;
+      for (index0 = 0; knownChips[index0].features; ++ index0)
+        /* Trick: we compare addresses here. We know it works because both
+           pointers were returned by sensors_get_detected_chips(), so they
+           refer to libsensors internal structures, which do not move. */
+        if (knownChips[index0].name == chip) {
+          chipindex = index0;
+          break;
+        }
+      if (chipindex >= 0) {
+        const ChipDescriptor *descriptor = &knownChips[chipindex];
         const FeatureDescriptor *features = descriptor->features;
-        int index0;
 
         for (index0 = 0; (ret == 0) && (num < MAX_RRD_SENSORS) && features[index0].format; ++ index0) {
@@ -168,6 +175,4 @@
             free (label);
         }
-        free (descriptor->features);
-        free (descriptor);
       }
     }
Index: /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sense.c
===================================================================
--- /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sense.c	(revision 4825)
+++ /lm-sensors/branches/lm-sensors-3.0.0/prog/sensord/sense.c	(revision 4828)
@@ -169,11 +169,15 @@
     ret = setChip (chip);
   } else {
-    ChipDescriptor *descriptor;
-    descriptor = generateChipDescriptor (chip);
-    if (descriptor) {
-      ret = doKnownChip (chip, descriptor, action);
-      free (descriptor->features);
-      free (descriptor);
-    }
+    int index0, chipindex = -1;
+    for (index0 = 0; knownChips[index0].features; ++ index0)
+      /* Trick: we compare addresses here. We know it works because both
+         pointers were returned by sensors_get_detected_chips(), so they
+         refer to libsensors internal structures, which do not move. */
+      if (knownChips[index0].name == chip) {
+        chipindex = index0;
+        break;
+      }
+    if (chipindex >= 0)
+      ret = doKnownChip (chip, &knownChips[chipindex], action);
   }
   return ret;
