summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-07-28 21:15:41 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-07-28 21:15:41 -0400
commite722334ab13ca7e9af198413a0a08df2e13fbd8c (patch)
treec83f081613d09fcdf4262bea033e3c5a23ad7a12
parent2363c7b0953098c87a811665bfc580bc59d0d3a5 (diff)
downloadrockbox-e722334ab1.tar.gz
rockbox-e722334ab1.zip
init_volume_names() has to be called AFTER storage_init()
...So just move that call into storage_init and be done with it! Hopefully this doesn't cause any functional regressions. Change-Id: I08700fbd1613638606a23ee3a0c2149123c2c24a
-rw-r--r--firmware/common/file_internal.c3
-rw-r--r--firmware/storage.c33
2 files changed, 19 insertions, 17 deletions
diff --git a/firmware/common/file_internal.c b/firmware/common/file_internal.c
index 28d370e15f..e4554670af 100644
--- a/firmware/common/file_internal.c
+++ b/firmware/common/file_internal.c
@@ -761,7 +761,4 @@ void filesystem_init(void)
mrsw_init(&file_internal_mrsw);
dc_init();
fileobj_mgr_init();
-#ifdef HAVE_MULTIVOLUME
- init_volume_names();
-#endif
}
diff --git a/firmware/storage.c b/firmware/storage.c
index 267b0b8dfb..ac4e35b66b 100644
--- a/firmware/storage.c
+++ b/firmware/storage.c
@@ -23,6 +23,7 @@
#include "ata_idle_notify.h"
#include "usb.h"
#include "disk.h"
+#include "pathfuncs.h"
#ifdef CONFIG_STORAGE_MULTI
@@ -275,21 +276,21 @@ int storage_init(void)
#ifdef CONFIG_STORAGE_MULTI
int i;
num_drives=0;
-
+
#if (CONFIG_STORAGE & STORAGE_ATA)
if ((rc=ata_init())) return rc;
-
+
int ata_drives = ata_num_drives(num_drives);
for (i=0; i<ata_drives; i++)
{
- storage_drivers[num_drives++] =
+ storage_drivers[num_drives++] =
(STORAGE_ATA<<DRIVER_OFFSET) | (i << DRIVE_OFFSET);
}
#endif
#if (CONFIG_STORAGE & STORAGE_MMC)
if ((rc=mmc_init())) return rc;
-
+
int mmc_drives = mmc_num_drives(num_drives);
for (i=0; i<mmc_drives ;i++)
{
@@ -300,7 +301,7 @@ int storage_init(void)
#if (CONFIG_STORAGE & STORAGE_SD)
if ((rc=sd_init())) return rc;
-
+
int sd_drives = sd_num_drives(num_drives);
for (i=0; i<sd_drives; i++)
{
@@ -311,7 +312,7 @@ int storage_init(void)
#if (CONFIG_STORAGE & STORAGE_NAND)
if ((rc=nand_init())) return rc;
-
+
int nand_drives = nand_num_drives(num_drives);
for (i=0; i<nand_drives; i++)
{
@@ -322,7 +323,7 @@ int storage_init(void)
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
if ((rc=ramdisk_init())) return rc;
-
+
int ramdisk_drives = ramdisk_num_drives(num_drives);
for (i=0; i<ramdisk_drives; i++)
{
@@ -334,6 +335,10 @@ int storage_init(void)
rc = STORAGE_FUNCTION(init)();
#endif /* CONFIG_STORAGE_MULTI */
+#ifdef HAVE_MULTIVOLUME
+ init_volume_names();
+#endif
+
storage_thread_init();
return rc;
}
@@ -520,7 +525,7 @@ bool storage_disk_is_active(void)
int storage_soft_reset(void)
{
int rc=0;
-
+
#if (CONFIG_STORAGE & STORAGE_ATA)
if ((rc=ata_soft_reset())) return rc;
#endif
@@ -548,7 +553,7 @@ int storage_soft_reset(void)
int storage_flush(void)
{
int rc=0;
-
+
#if (CONFIG_STORAGE & STORAGE_ATA)
//if ((rc=ata_flush())) return rc;
#endif
@@ -648,7 +653,7 @@ long storage_last_disk_activity(void)
{
long max=0;
long t;
-
+
#if (CONFIG_STORAGE & STORAGE_ATA)
t=ata_last_disk_activity();
if (t>max) max=t;
@@ -681,7 +686,7 @@ int storage_spinup_time(void)
{
int max=0;
int t;
-
+
#if (CONFIG_STORAGE & STORAGE_ATA)
t=ata_spinup_time();
if (t>max) max=t;
@@ -716,7 +721,7 @@ void storage_get_info(int drive, struct storage_info *info)
{
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
-
+
switch(driver)
{
#if (CONFIG_STORAGE & STORAGE_ATA)
@@ -752,7 +757,7 @@ bool storage_removable(int drive)
{
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
-
+
switch(driver)
{
#if (CONFIG_STORAGE & STORAGE_ATA)
@@ -789,7 +794,7 @@ bool storage_present(int drive)
{
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
-
+
switch(driver)
{
#if (CONFIG_STORAGE & STORAGE_ATA)