From d052ced874172e95fdc1d096205ac4dfe38907f3 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Thu, 26 Nov 2009 16:57:30 +0000 Subject: Merge branch 'hotswap' git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23759 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/fat.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'firmware/drivers/fat.c') diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index b5f6e77837..169672f08e 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -458,11 +458,15 @@ int fat_mount(IF_MV2(int volume,) IF_MD2(int drive,) long startsector) int fat_unmount(int volume, bool flush) { int rc; +#ifdef HAVE_MULTIVOLUME struct bpb* fat_bpb = &fat_bpbs[volume]; +#else + (void)volume; +#endif if(flush) { - rc = flush_fat(fat_bpb); /* the clean way, while still alive */ + rc = flush_fat(IF_MV(fat_bpb)); /* the clean way, while still alive */ } else { /* volume is not accessible any more, e.g. MMC removed */ @@ -471,7 +475,11 @@ int fat_unmount(int volume, bool flush) for(i = 0;i < FAT_CACHE_SIZE;i++) { struct fat_cache_entry *fce = &fat_cache[i]; - if(fce->inuse && fce->fat_vol == fat_bpb) + if(fce->inuse +#ifdef HAVE_MULTIVOLUME + && fce->fat_vol == fat_bpb +#endif + ) { fce->inuse = false; /* discard all from that volume */ fce->dirty = false; @@ -480,7 +488,9 @@ int fat_unmount(int volume, bool flush) mutex_unlock(&cache_mutex); rc = 0; } +#ifdef HAVE_MULTIVOLUME fat_bpb->mounted = false; +#endif return rc; } #endif /* #ifdef HAVE_HOTSWAP */ -- cgit v1.2.3