mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
ata: Use consistent error values for all invocations of set_features()
set_features() returns an error between -1 and -39, so make sure every caller adds -60 to that so no matter where an error is printed the value is consistent. Change-Id: Ic81108ee70a2cb5ff7ea2445f086420fe850d07e
This commit is contained in:
parent
f3de4729ce
commit
025841cfb5
1 changed files with 5 additions and 5 deletions
|
@ -962,8 +962,8 @@ static int perform_soft_reset(void)
|
|||
if (identify())
|
||||
return -5;
|
||||
|
||||
if (set_features())
|
||||
return -2;
|
||||
if ((ret = set_features()))
|
||||
return -60 + ret;
|
||||
|
||||
if (set_multiple_mode(multisectors))
|
||||
return -3;
|
||||
|
@ -1013,7 +1013,7 @@ static int ata_power_on(void)
|
|||
|
||||
rc = set_features();
|
||||
if (rc)
|
||||
return rc * 10 - 2;
|
||||
return -60 + rc;
|
||||
|
||||
if (set_multiple_mode(multisectors))
|
||||
return -3;
|
||||
|
@ -1284,7 +1284,7 @@ int STORAGE_INIT_ATTR ata_init(void)
|
|||
goto error;
|
||||
}
|
||||
|
||||
rc = set_features();
|
||||
rc = set_features(); // rror codes are between -1 and -49
|
||||
if (rc) {
|
||||
rc = -60 + rc;
|
||||
goto error;
|
||||
|
@ -1321,7 +1321,7 @@ int STORAGE_INIT_ATTR ata_init(void)
|
|||
}
|
||||
rc = set_multiple_mode(multisectors);
|
||||
if (rc)
|
||||
rc = -70 + rc;
|
||||
rc = -100 + rc;
|
||||
|
||||
error:
|
||||
mutex_unlock(&ata_mtx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue