Set up u-boot glue code and patching scripts.
[yaffs2.git] / direct / yaffsfs.c
index fffc11eece7b691892c767c5122a04e556374514..917c202c39a851ef6265bb50d315ffedd3ac9e8e 100644 (file)
@@ -2768,8 +2768,27 @@ void yaffs_remove_device(struct yaffs_dev *dev)
        list_del_init(&dev->dev_list);
 }
 
        list_del_init(&dev->dev_list);
 }
 
+/* Functions to iterate through devices. NB Use with extreme care! */
 
 
+static struct list_head *dev_iterator;
+void yaffs_dev_rewind(void)
+{
+       dev_iterator = yaffsfs_deviceList.next;
+}
 
 
+struct yaffs_dev *yaffs_next_dev(void)
+{
+       struct yaffs_dev *retval;
+
+       if(!dev_iterator)
+               return NULL;
+       if(dev_iterator == &yaffsfs_deviceList)
+               return NULL;
+
+       retval = list_entry(dev_iterator, struct yaffs_dev, dev_list);
+       dev_iterator = dev_iterator->next;
+       return retval;
+}
 
 /* Directory search stuff. */
 
 
 /* Directory search stuff. */