From 1a5962f2be995b669f2cc3a49be33b3ecd8dede0 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Wed, 29 Dec 2004 22:10:24 +0000 Subject: Shared mounting code, also more general. It will mount multiple HD partitions, too, once HAVE_MULTIVOLUME is enabled. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5518 a1c6a512-1295-4272-9138-f99709370657 --- firmware/usb.c | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'firmware/usb.c') diff --git a/firmware/usb.c b/firmware/usb.c index ab8e080c45..7060ccfe23 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -122,7 +122,6 @@ static void usb_enable(bool on) static void usb_slave_mode(bool on) { int rc; - struct partinfo* pinfo; if(on) { @@ -135,7 +134,6 @@ static void usb_slave_mode(bool on) } else { - int i; DEBUGF("Leaving USB slave mode\n"); /* Let the ISDx00 settle */ @@ -146,6 +144,7 @@ static void usb_slave_mode(bool on) rc = ata_init(); if(rc) { + /* fixme: can we remove this? (already such in main.c) */ char str[32]; lcd_clear_display(); snprintf(str, 31, "ATA error: %d", rc); @@ -157,38 +156,10 @@ static void usb_slave_mode(bool on) panicf("ata: %d",rc); } - pinfo = disk_init(IF_MV(0)); - if (!pinfo) - panicf("disk: NULL"); - - fat_init(); - for ( i=0; i<4; i++ ) { - rc = fat_mount(IF_MV2(0,) IF_MV2(0,) pinfo[i].start); - if (!rc) - break; /* only one partition gets mounted as of now */ - } - if (i==4) + rc = disk_mount_all(); + if (rc <= 0) /* no partition */ panicf("mount: %d",rc); -#ifdef HAVE_MULTIVOLUME - /* mount partition on the optional volume */ -#ifdef HAVE_MMC - if (mmc_detect()) /* for Ondio, only if card detected */ -#endif - { - pinfo = disk_init(1); - if (pinfo) - { - for ( i=0; i<4; i++ ) { - if (!fat_mount(1, 1, pinfo[i].start)) - break; /* only one partition gets mounted as of now */ - } - if ( i==4 ) { - rc = fat_mount(1, 1, 0); - } - } - } -#endif /* #ifdef HAVE_MULTIVOLUME */ } } -- cgit v1.2.3