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:
Frank Gevaerts 2010-05-29 20:44:09 +00:00
parent c401eecd26
commit acf98d9e7f

View file

@ -581,8 +581,6 @@ void storage_get_info(int drive, struct storage_info *info)
#ifdef HAVE_HOTSWAP
bool storage_removable(int drive)
{
bool ret = false;
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
@ -590,37 +588,36 @@ bool storage_removable(int drive)
{
#if (CONFIG_STORAGE & STORAGE_ATA)
case STORAGE_ATA:
ret = ata_removable(ldrive);
return ata_removable(ldrive);
#endif
#if (CONFIG_STORAGE & STORAGE_MMC)
case STORAGE_MMC:
ret = mmc_removable(ldrive);
return mmc_removable(ldrive);
#endif
#if (CONFIG_STORAGE & STORAGE_SD)
case STORAGE_SD:
ret = sd_removable(ldrive);
return sd_removable(ldrive);
#endif
#if (CONFIG_STORAGE & STORAGE_NAND)
case STORAGE_NAND:
ret = false;
return false;
#endif
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
case STORAGE_RAMDISK:
ret = false;
return false;
#endif
default:
return false;
}
return ret;
}
bool storage_present(int drive)
{
bool ret = false;
int driver=(storage_drivers[drive] & DRIVER_MASK)>>DRIVER_OFFSET;
int ldrive=(storage_drivers[drive] & DRIVE_MASK)>>DRIVE_OFFSET;
@ -628,31 +625,35 @@ bool storage_present(int drive)
{
#if (CONFIG_STORAGE & STORAGE_ATA)
case STORAGE_ATA:
ret = ata_present(ldrive);
return ata_present(ldrive);
#endif
#if (CONFIG_STORAGE & STORAGE_MMC)
case STORAGE_MMC:
ret = mmc_present(ldrive);
return mmc_present(ldrive);
#endif
#if (CONFIG_STORAGE & STORAGE_SD)
case STORAGE_SD:
ret = sd_present(ldrive);
return sd_present(ldrive);
break;
#endif
#if (CONFIG_STORAGE & STORAGE_NAND)
case STORAGE_NAND:
ret = true;
return true;
break;
#endif
#if (CONFIG_STORAGE & STORAGE_RAMDISK)
case STORAGE_RAMDISK:
ret = true;
return true;
break;
#endif
default:
return false;
}
return ret;
}
#endif