forked from Mirror/GodMode9
diskio.c: use the correct error codes
This commit is contained in:
parent
f74d9ddfd7
commit
5880777e18
@ -171,18 +171,18 @@ DRESULT disk_read (
|
||||
if (type == TYPE_NONE) {
|
||||
return RES_PARERR;
|
||||
} else if (type == TYPE_SDCARD) {
|
||||
if (sdmmc_sdcard_readsectors(sector, count, buff))
|
||||
return RES_PARERR;
|
||||
if (sdmmc_sdcard_readsectors(sector, count, buff) != 0)
|
||||
return RES_ERROR;
|
||||
} else if (type == TYPE_IMAGE) {
|
||||
if (ReadImageSectors(buff, sector, count))
|
||||
return RES_PARERR;
|
||||
if (ReadImageSectors(buff, sector, count) != 0)
|
||||
return RES_ERROR;
|
||||
} else if (type == TYPE_RAMDRV) {
|
||||
if (ReadRamDriveSectors(buff, sector, count))
|
||||
return RES_PARERR;
|
||||
if (ReadRamDriveSectors(buff, sector, count) != 0)
|
||||
return RES_ERROR;
|
||||
} else {
|
||||
FATpartition* fat_info = PART_INFO(pdrv);
|
||||
if (ReadNandSectors(buff, fat_info->offset + sector, count, fat_info->keyslot, type))
|
||||
return RES_PARERR;
|
||||
if (ReadNandSectors(buff, fat_info->offset + sector, count, fat_info->keyslot, type) != 0)
|
||||
return RES_ERROR;
|
||||
}
|
||||
|
||||
return RES_OK;
|
||||
@ -208,18 +208,18 @@ DRESULT disk_write (
|
||||
if (type == TYPE_NONE) {
|
||||
return RES_PARERR;
|
||||
} else if (type == TYPE_SDCARD) {
|
||||
if (sdmmc_sdcard_writesectors(sector, count, (BYTE *)buff))
|
||||
return RES_PARERR;
|
||||
if (sdmmc_sdcard_writesectors(sector, count, (BYTE *)buff) != 0)
|
||||
return RES_ERROR;
|
||||
} else if (type == TYPE_IMAGE) {
|
||||
if (WriteImageSectors(buff, sector, count))
|
||||
return RES_PARERR;
|
||||
if (WriteImageSectors(buff, sector, count) != 0)
|
||||
return RES_ERROR;
|
||||
} else if (type == TYPE_RAMDRV) {
|
||||
if (WriteRamDriveSectors(buff, sector, count))
|
||||
return RES_PARERR;
|
||||
if (WriteRamDriveSectors(buff, sector, count) != 0)
|
||||
return RES_ERROR;
|
||||
} else {
|
||||
FATpartition* fat_info = PART_INFO(pdrv);
|
||||
if (WriteNandSectors(buff, fat_info->offset + sector, count, fat_info->keyslot, type))
|
||||
return RES_PARERR; // unstubbed!
|
||||
if (WriteNandSectors(buff, fat_info->offset + sector, count, fat_info->keyslot, type) != 0)
|
||||
return RES_ERROR; // unstubbed!
|
||||
}
|
||||
|
||||
return RES_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user