+static void __free_hddtemp_info(struct hdd_info *hdi)
+{
+ if (hdi->next)
+ __free_hddtemp_info(hdi->next);
+ free(hdi->dev);
+ free(hdi);
+}
+
+static void free_hddtemp_info(void)
+{
+ DBGP("free_hddtemp_info() called");
+ if (!hdd_info_head.next)
+ return;
+ __free_hddtemp_info(hdd_info_head.next);
+ hdd_info_head.next = NULL;
+}
+
+static void add_hddtemp_info(char *dev, short temp, char unit)
+{
+ struct hdd_info *hdi = &hdd_info_head;
+
+ DBGP("add_hddtemp_info(%s, %d, %c) being called", dev, temp, unit);
+ while (hdi->next)
+ hdi = hdi->next;
+
+ hdi->next = malloc(sizeof(struct hdd_info));
+ memset(hdi->next, 0, sizeof(struct hdd_info));
+ hdi->next->dev = strdup(dev);
+ hdi->next->temp = temp;
+ hdi->next->unit = unit;
+}