forked from len0rd/rockbox
fix broken case handling in storage_present() and storage_removable(). Those were buggy for targets with a hotswappable drive *and* more than one storage driver (i.e. only the D2 was probably affected)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26395 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c401eecd26
commit
acf98d9e7f
1 changed files with 19 additions and 18 deletions
|
@ -581,8 +581,6 @@ void storage_get_info(int drive, struct storage_info *info)
|
||||||
#ifdef HAVE_HOTSWAP
|
#ifdef HAVE_HOTSWAP
|
||||||
bool storage_removable(int drive)
|
bool storage_removable(int drive)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
|
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
|
||||||
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
|
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
|
||||||
|
|
||||||
|
@ -590,37 +588,36 @@ bool storage_removable(int drive)
|
||||||
{
|
{
|
||||||
#if (CONFIG_STORAGE & STORAGE_ATA)
|
#if (CONFIG_STORAGE & STORAGE_ATA)
|
||||||
case STORAGE_ATA:
|
case STORAGE_ATA:
|
||||||
ret = ata_removable(ldrive);
|
return ata_removable(ldrive);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_MMC)
|
#if (CONFIG_STORAGE & STORAGE_MMC)
|
||||||
case STORAGE_MMC:
|
case STORAGE_MMC:
|
||||||
ret = mmc_removable(ldrive);
|
return mmc_removable(ldrive);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_SD)
|
#if (CONFIG_STORAGE & STORAGE_SD)
|
||||||
case STORAGE_SD:
|
case STORAGE_SD:
|
||||||
ret = sd_removable(ldrive);
|
return sd_removable(ldrive);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_NAND)
|
#if (CONFIG_STORAGE & STORAGE_NAND)
|
||||||
case STORAGE_NAND:
|
case STORAGE_NAND:
|
||||||
ret = false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
|
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
|
||||||
case STORAGE_RAMDISK:
|
case STORAGE_RAMDISK:
|
||||||
ret = false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool storage_present(int drive)
|
bool storage_present(int drive)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
|
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
|
||||||
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
|
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
|
||||||
|
|
||||||
|
@ -628,31 +625,35 @@ bool storage_present(int drive)
|
||||||
{
|
{
|
||||||
#if (CONFIG_STORAGE & STORAGE_ATA)
|
#if (CONFIG_STORAGE & STORAGE_ATA)
|
||||||
case STORAGE_ATA:
|
case STORAGE_ATA:
|
||||||
ret = ata_present(ldrive);
|
return ata_present(ldrive);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_MMC)
|
#if (CONFIG_STORAGE & STORAGE_MMC)
|
||||||
case STORAGE_MMC:
|
case STORAGE_MMC:
|
||||||
ret = mmc_present(ldrive);
|
return mmc_present(ldrive);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_SD)
|
#if (CONFIG_STORAGE & STORAGE_SD)
|
||||||
case STORAGE_SD:
|
case STORAGE_SD:
|
||||||
ret = sd_present(ldrive);
|
return sd_present(ldrive);
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_NAND)
|
#if (CONFIG_STORAGE & STORAGE_NAND)
|
||||||
case STORAGE_NAND:
|
case STORAGE_NAND:
|
||||||
ret = true;
|
return true;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
|
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
|
||||||
case STORAGE_RAMDISK:
|
case STORAGE_RAMDISK:
|
||||||
ret = true;
|
return true;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue