summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/fat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index c989c86f84..d9f7c3ceaa 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -230,6 +230,7 @@ struct bpb
230static struct bpb fat_bpbs[NUM_VOLUMES]; /* mounted partition info */ 230static struct bpb fat_bpbs[NUM_VOLUMES]; /* mounted partition info */
231 231
232static int update_fsinfo(IF_MV_NONVOID(struct bpb* fat_bpb)); 232static int update_fsinfo(IF_MV_NONVOID(struct bpb* fat_bpb));
233static int flush_fat(IF_MV_NONVOID(struct bpb* fat_bpb));
233static int bpb_is_sane(IF_MV_NONVOID(struct bpb* fat_bpb)); 234static int bpb_is_sane(IF_MV_NONVOID(struct bpb* fat_bpb));
234static void *cache_fat_sector(IF_MV2(struct bpb* fat_bpb,) int secnum, bool dirty); 235static void *cache_fat_sector(IF_MV2(struct bpb* fat_bpb,) int secnum, bool dirty);
235static int create_dos_name(const unsigned char *name, unsigned char *newname); 236static int create_dos_name(const unsigned char *name, unsigned char *newname);
@@ -483,10 +484,12 @@ int fat_mount(IF_MV2(int volume,) IF_MV2(int drive,) int startsector)
483#ifdef HAVE_MULTIVOLUME 484#ifdef HAVE_MULTIVOLUME
484int fat_unmount(int volume, bool flush) 485int fat_unmount(int volume, bool flush)
485{ 486{
487 int rc;
486 struct bpb* fat_bpb = &fat_bpbs[volume]; 488 struct bpb* fat_bpb = &fat_bpbs[volume];
489
487 if(flush) 490 if(flush)
488 { 491 {
489 flush_fat(fat_bpb); /* the clean way, while still alive */ 492 rc = flush_fat(fat_bpb); /* the clean way, while still alive */
490 } 493 }
491 else 494 else
492 { /* volume is not accessible any more, e.g. MMC removed */ 495 { /* volume is not accessible any more, e.g. MMC removed */
@@ -502,8 +505,10 @@ int fat_unmount(int volume, bool flush)
502 } 505 }
503 } 506 }
504 mutex_unlock(&cache_mutex); 507 mutex_unlock(&cache_mutex);
508 rc = 0;
505 } 509 }
506 fat_bpb->mounted = false; 510 fat_bpb->mounted = false;
511 return rc;
507} 512}
508#endif 513#endif
509 514