优化mount 函数,返回正确值。
authorSnickerSun <snickersun@163.com>
Mon, 8 Apr 2024 08:58:19 +0000 (16:58 +0800)
committerSnickerSun <snickersun@163.com>
Mon, 8 Apr 2024 08:58:19 +0000 (16:58 +0800)
code/sdk/drivers/drivers/driver/nand_flash/nand/nandflash_config.c

index 4f674c5..a6d425b 100755 (executable)
@@ -72,13 +72,16 @@ static int mount_partition_by_index(uint32_t index)
     }
     ret = mount(dev_name, g_volume_names[index], "yaffs", 0, NULL);
     if (ret != 0) {
+        PRINT("[%d] yaffs mount fail, ret = %d\r\n", index, ret);
         return ret;
     }
     ret = yaffs_sync(g_volume_names[index]);
     if (ret != 0) {
-        PRINT("[%d] yaffs_sync fail, ret = %d", index, ret);
+        PRINT("[%d] yaffs_sync fail, ret = %d\r\n", index, ret);
+        return ret;
     }
-    return ret;
+    PRINT("yaffs mount success [%d]\r\n",index);
+    return 0;
 }
 static int formate_filesystem_init(uint32_t total_block_num)
 {
@@ -113,10 +116,10 @@ static int formate_filesystem_init(uint32_t total_block_num)
               g_volume_names[index], part_start_sector, part_count_sector);
         
         part_start_sector += part_count_sector;
-
+    
         
     }
-    return ret;
+    return 0;
 }
 
 void nandflash_yaffs_sync(void)