libblkid-tiny: add support for NTFS superblock
[project/fstools.git] / libfstools / volume.c
index 4dc0a8e..0d293d5 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "../fs-state.h"
+#include "libfstools.h"
 #include "volume.h"
 
-enum {
-       FLASH_NOR,
-       FLASH_NAND,
-};
-
 static LIST_HEAD(drivers);
 
 void
@@ -33,20 +28,16 @@ volume_register_driver(struct driver *d)
 
 struct volume* volume_find(char *name)
 {
-       struct volume *v = malloc(sizeof(struct volume));
+       struct volume *v;
        struct driver *d;
 
-       if (!v)
-               return NULL;
-
        list_for_each_entry(d, &drivers, list) {
-               memset(v, 0, sizeof(struct volume));
-
-               if (d->find && !d->find(v, name))
-                       return v;
+               if (d->find) {
+                       v = d->find(name);
+                       if (v)
+                               return v;
+               }
        }
 
-       free(v);
-
        return NULL;
 }