From 025841cfb5a8f5a48fa32fa71cf447f045d64e29 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 29 Jun 2024 10:07:25 -0400 Subject: 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 --- firmware/drivers/ata.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'firmware/drivers') diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index b245cbc09e..d82fb173cc 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -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); -- cgit v1.2.3