device: Do not open code the records freeing routine
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 15 Feb 2013 15:25:58 +0000 (16:25 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 15 Feb 2013 15:28:10 +0000 (16:28 +0100)
Use near_ndef_records_free instead.

src/device.c

index 3d52a69..29cb671 100644 (file)
@@ -61,15 +61,10 @@ static GSList *driver_list = NULL;
 static void free_device(gpointer data)
 {
        struct near_device *device = data;
-       GList *list;
 
        DBG("device %p", device);
 
-       for (list = device->records; list; list = list->next) {
-               struct near_ndef_record *record = list->data;
-
-               __near_ndef_record_free(record);
-       }
+       near_ndef_records_free(device->records);
 
        g_list_free(device->records);
        g_free(device->path);