yaffs direct: Prevent yaffs_start_up being called twice.
[yaffs2.git] / direct / yaffsfs.c
index 2668b22daf46eeb36b3720847aecb75735535a54..37d6cae1d0cce812d4217f6444c06fbaf8360dd5 100644 (file)
@@ -2720,6 +2720,14 @@ int yaffs_inodecount(const YCHAR *path)
 
 void yaffs_add_device(struct yaffs_dev *dev)
 {
 
 void yaffs_add_device(struct yaffs_dev *dev)
 {
+       struct list_head *cfg;
+       /* First check that the device is not in the list. */
+
+       list_for_each(cfg, &yaffsfs_deviceList){
+               if(dev == list_entry(cfg, struct yaffs_dev, dev_list))
+                       return;
+       }
+
        dev->is_mounted = 0;
        dev->param.remove_obj_fn = yaffsfs_RemoveObjectCallback;
 
        dev->is_mounted = 0;
        dev->param.remove_obj_fn = yaffsfs_RemoveObjectCallback;