mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27: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())
|
if (identify())
|
||||||
return -5;
|
return -5;
|
||||||
|
|
||||||
if (set_features())
|
if ((ret = set_features()))
|
||||||
return -2;
|
return -60 + ret;
|
||||||
|
|
||||||
if (set_multiple_mode(multisectors))
|
if (set_multiple_mode(multisectors))
|
||||||
return -3;
|
return -3;
|
||||||
|
@ -1013,7 +1013,7 @@ static int ata_power_on(void)
|
||||||
|
|
||||||
rc = set_features();
|
rc = set_features();
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc * 10 - 2;
|
return -60 + rc;
|
||||||
|
|
||||||
if (set_multiple_mode(multisectors))
|
if (set_multiple_mode(multisectors))
|
||||||
return -3;
|
return -3;
|
||||||
|
@ -1284,7 +1284,7 @@ int STORAGE_INIT_ATTR ata_init(void)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = set_features();
|
rc = set_features(); // rror codes are between -1 and -49
|
||||||
if (rc) {
|
if (rc) {
|
||||||
rc = -60 + rc;
|
rc = -60 + rc;
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -1321,7 +1321,7 @@ int STORAGE_INIT_ATTR ata_init(void)
|
||||||
}
|
}
|
||||||
rc = set_multiple_mode(multisectors);
|
rc = set_multiple_mode(multisectors);
|
||||||
if (rc)
|
if (rc)
|
||||||
rc = -70 + rc;
|
rc = -100 + rc;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
mutex_unlock(&ata_mtx);
|
mutex_unlock(&ata_mtx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue