summaryrefslogtreecommitdiff
path: root/firmware
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 /firmware
parent2363c7b0953098c87a811665bfc580bc59d0d3a5 (diff)
downloadrockbox-e722334ab13ca7e9af198413a0a08df2e13fbd8c.tar.gz
rockbox-e722334ab13ca7e9af198413a0a08df2e13fbd8c.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
Diffstat (limited to 'firmware')
-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)
761 mrsw_init(&file_internal_mrsw); 761 mrsw_init(&file_internal_mrsw);
762 dc_init(); 762 dc_init();
763 fileobj_mgr_init(); 763 fileobj_mgr_init();
764#ifdef HAVE_MULTIVOLUME
765 init_volume_names();
766#endif
767} 764}
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 @@
23#include "ata_idle_notify.h" 23#include "ata_idle_notify.h"
24#include "usb.h" 24#include "usb.h"
25#include "disk.h" 25#include "disk.h"
26#include "pathfuncs.h"
26 27
27#ifdef CONFIG_STORAGE_MULTI 28#ifdef CONFIG_STORAGE_MULTI
28 29
@@ -275,21 +276,21 @@ int storage_init(void)
275#ifdef CONFIG_STORAGE_MULTI 276#ifdef CONFIG_STORAGE_MULTI
276 int i; 277 int i;
277 num_drives=0; 278 num_drives=0;
278 279
279#if (CONFIG_STORAGE & STORAGE_ATA) 280#if (CONFIG_STORAGE & STORAGE_ATA)
280 if ((rc=ata_init())) return rc; 281 if ((rc=ata_init())) return rc;
281 282
282 int ata_drives = ata_num_drives(num_drives); 283 int ata_drives = ata_num_drives(num_drives);
283 for (i=0; i<ata_drives; i++) 284 for (i=0; i<ata_drives; i++)
284 { 285 {
285 storage_drivers[num_drives++] = 286 storage_drivers[num_drives++] =
286 (STORAGE_ATA<<DRIVER_OFFSET) | (i << DRIVE_OFFSET); 287 (STORAGE_ATA<<DRIVER_OFFSET) | (i << DRIVE_OFFSET);
287 } 288 }
288#endif 289#endif
289 290
290#if (CONFIG_STORAGE & STORAGE_MMC) 291#if (CONFIG_STORAGE & STORAGE_MMC)
291 if ((rc=mmc_init())) return rc; 292 if ((rc=mmc_init())) return rc;
292 293
293 int mmc_drives = mmc_num_drives(num_drives); 294 int mmc_drives = mmc_num_drives(num_drives);
294 for (i=0; i<mmc_drives ;i++) 295 for (i=0; i<mmc_drives ;i++)
295 { 296 {
@@ -300,7 +301,7 @@ int storage_init(void)
300 301
301#if (CONFIG_STORAGE & STORAGE_SD) 302#if (CONFIG_STORAGE & STORAGE_SD)
302 if ((rc=sd_init())) return rc; 303 if ((rc=sd_init())) return rc;
303 304
304 int sd_drives = sd_num_drives(num_drives); 305 int sd_drives = sd_num_drives(num_drives);
305 for (i=0; i<sd_drives; i++) 306 for (i=0; i<sd_drives; i++)
306 { 307 {
@@ -311,7 +312,7 @@ int storage_init(void)
311 312
312#if (CONFIG_STORAGE & STORAGE_NAND) 313#if (CONFIG_STORAGE & STORAGE_NAND)
313 if ((rc=nand_init())) return rc; 314 if ((rc=nand_init())) return rc;
314 315
315 int nand_drives = nand_num_drives(num_drives); 316 int nand_drives = nand_num_drives(num_drives);
316 for (i=0; i<nand_drives; i++) 317 for (i=0; i<nand_drives; i++)
317 { 318 {
@@ -322,7 +323,7 @@ int storage_init(void)
322 323
323#if (CONFIG_STORAGE & STORAGE_RAMDISK) 324#if (CONFIG_STORAGE & STORAGE_RAMDISK)
324 if ((rc=ramdisk_init())) return rc; 325 if ((rc=ramdisk_init())) return rc;
325 326
326 int ramdisk_drives = ramdisk_num_drives(num_drives); 327 int ramdisk_drives = ramdisk_num_drives(num_drives);
327 for (i=0; i<ramdisk_drives; i++) 328 for (i=0; i<ramdisk_drives; i++)
328 { 329 {
@@ -334,6 +335,10 @@ int storage_init(void)
334 rc = STORAGE_FUNCTION(init)(); 335 rc = STORAGE_FUNCTION(init)();
335#endif /* CONFIG_STORAGE_MULTI */ 336#endif /* CONFIG_STORAGE_MULTI */
336 337
338#ifdef HAVE_MULTIVOLUME
339 init_volume_names();
340#endif
341
337 storage_thread_init(); 342 storage_thread_init();
338 return rc; 343 return rc;
339} 344}
@@ -520,7 +525,7 @@ bool storage_disk_is_active(void)
520int storage_soft_reset(void) 525int storage_soft_reset(void)
521{ 526{
522 int rc=0; 527 int rc=0;
523 528
524#if (CONFIG_STORAGE & STORAGE_ATA) 529#if (CONFIG_STORAGE & STORAGE_ATA)
525 if ((rc=ata_soft_reset())) return rc; 530 if ((rc=ata_soft_reset())) return rc;
526#endif 531#endif
@@ -548,7 +553,7 @@ int storage_soft_reset(void)
548int storage_flush(void) 553int storage_flush(void)
549{ 554{
550 int rc=0; 555 int rc=0;
551 556
552#if (CONFIG_STORAGE & STORAGE_ATA) 557#if (CONFIG_STORAGE & STORAGE_ATA)
553 //if ((rc=ata_flush())) return rc; 558 //if ((rc=ata_flush())) return rc;
554#endif 559#endif
@@ -648,7 +653,7 @@ long storage_last_disk_activity(void)
648{ 653{
649 long max=0; 654 long max=0;
650 long t; 655 long t;
651 656
652#if (CONFIG_STORAGE & STORAGE_ATA) 657#if (CONFIG_STORAGE & STORAGE_ATA)
653 t=ata_last_disk_activity(); 658 t=ata_last_disk_activity();
654 if (t>max) max=t; 659 if (t>max) max=t;
@@ -681,7 +686,7 @@ int storage_spinup_time(void)
681{ 686{
682 int max=0; 687 int max=0;
683 int t; 688 int t;
684 689
685#if (CONFIG_STORAGE & STORAGE_ATA) 690#if (CONFIG_STORAGE & STORAGE_ATA)
686 t=ata_spinup_time(); 691 t=ata_spinup_time();
687 if (t>max) max=t; 692 if (t>max) max=t;
@@ -716,7 +721,7 @@ void storage_get_info(int drive, struct storage_info *info)
716{ 721{
717 int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET; 722 int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
718 int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET; 723 int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
719 724
720 switch(driver) 725 switch(driver)
721 { 726 {
722#if (CONFIG_STORAGE & STORAGE_ATA) 727#if (CONFIG_STORAGE & STORAGE_ATA)
@@ -752,7 +757,7 @@ bool storage_removable(int drive)
752{ 757{
753 int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET; 758 int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
754 int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET; 759 int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
755 760
756 switch(driver) 761 switch(driver)
757 { 762 {
758#if (CONFIG_STORAGE & STORAGE_ATA) 763#if (CONFIG_STORAGE & STORAGE_ATA)
@@ -789,7 +794,7 @@ bool storage_present(int drive)
789{ 794{
790 int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET; 795 int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
791 int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET; 796 int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
792 797
793 switch(driver) 798 switch(driver)
794 { 799 {
795#if (CONFIG_STORAGE & STORAGE_ATA) 800#if (CONFIG_STORAGE & STORAGE_ATA)