diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/ata.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index fb60ae3895..9331cd60d9 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -824,10 +824,12 @@ int ata_init(void) | |||
824 | return -2; | 824 | return -2; |
825 | } | 825 | } |
826 | 826 | ||
827 | if (rc = master_slave_detect()) | 827 | rc = master_slave_detect(); |
828 | if (rc) | ||
828 | return -10 + rc; | 829 | return -10 + rc; |
829 | 830 | ||
830 | if (rc = io_address_detect()) | 831 | rc = io_address_detect(); |
832 | if (rc) | ||
831 | return -20 + rc; | 833 | return -20 + rc; |
832 | 834 | ||
833 | /* symptom fix: else check_registers() below may fail */ | 835 | /* symptom fix: else check_registers() below may fail */ |
@@ -836,13 +838,16 @@ int ata_init(void) | |||
836 | return -29; | 838 | return -29; |
837 | } | 839 | } |
838 | 840 | ||
839 | if (rc = check_registers()) | 841 | rc = check_registers(); |
842 | if (rc) | ||
840 | return -30 + rc; | 843 | return -30 + rc; |
841 | 844 | ||
842 | if (rc = freeze_lock()) | 845 | rc = freeze_lock(); |
846 | if (rc) | ||
843 | return -40 + rc; | 847 | return -40 + rc; |
844 | 848 | ||
845 | if (rc = identify()) | 849 | rc = identify(); |
850 | if (rc) | ||
846 | return -50 + rc; | 851 | return -50 + rc; |
847 | multisectors = identify_info[47] & 0xff; | 852 | multisectors = identify_info[47] & 0xff; |
848 | DEBUGF("ata: %d sectors per ata request\n",multisectors); | 853 | DEBUGF("ata: %d sectors per ata request\n",multisectors); |
@@ -852,7 +857,8 @@ int ata_init(void) | |||
852 | sizeof(ata_stack), ata_thread_name); | 857 | sizeof(ata_stack), ata_thread_name); |
853 | initialized = true; | 858 | initialized = true; |
854 | } | 859 | } |
855 | if (rc = set_multiple_mode(multisectors)) | 860 | rc = set_multiple_mode(multisectors); |
861 | if (rc) | ||
856 | return -60 + rc; | 862 | return -60 + rc; |
857 | 863 | ||
858 | return 0; | 864 | return 0; |