diff options
Diffstat (limited to 'firmware/drivers/ata_mmc.c')
-rw-r--r-- | firmware/drivers/ata_mmc.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index 6303ca2851..64a7ba4bfd 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -98,9 +98,6 @@ static bool mmc_monitor_enabled = true; | |||
98 | #endif | 98 | #endif |
99 | static bool initialized = false; | 99 | static bool initialized = false; |
100 | static bool new_mmc_circuit; | 100 | static bool new_mmc_circuit; |
101 | static bool delayed_write = false; | ||
102 | static unsigned char delayed_sector[SECTOR_SIZE]; | ||
103 | static int delayed_sector_num; | ||
104 | 101 | ||
105 | static enum { | 102 | static enum { |
106 | MMC_UNKNOWN, | 103 | MMC_UNKNOWN, |
@@ -805,10 +802,6 @@ int ata_read_sectors(IF_MV2(int drive,) | |||
805 | 802 | ||
806 | deselect_card(); | 803 | deselect_card(); |
807 | 804 | ||
808 | /* only flush if reading went ok */ | ||
809 | if ( (rc == 0) && delayed_write ) | ||
810 | ata_flush(); | ||
811 | |||
812 | return rc; | 805 | return rc; |
813 | } | 806 | } |
814 | 807 | ||
@@ -960,33 +953,9 @@ int ata_write_sectors(IF_MV2(int drive,) | |||
960 | 953 | ||
961 | deselect_card(); | 954 | deselect_card(); |
962 | 955 | ||
963 | /* only flush if writing went ok */ | ||
964 | if ( (rc == 0) && delayed_write ) | ||
965 | ata_flush(); | ||
966 | |||
967 | return rc; | 956 | return rc; |
968 | } | 957 | } |
969 | 958 | ||
970 | /* While there is no spinup, the delayed write is still here to avoid | ||
971 | wearing the flash unnecessarily */ | ||
972 | extern void ata_delayed_write(unsigned long sector, const void* buf) | ||
973 | { | ||
974 | memcpy(delayed_sector, buf, SECTOR_SIZE); | ||
975 | delayed_sector_num = sector; | ||
976 | delayed_write = true; | ||
977 | } | ||
978 | |||
979 | /* write the delayed sector to volume 0 */ | ||
980 | extern void ata_flush(void) | ||
981 | { | ||
982 | if ( delayed_write ) | ||
983 | { | ||
984 | DEBUGF("ata_flush()\n"); | ||
985 | delayed_write = false; | ||
986 | ata_write_sectors(IF_MV2(0,) delayed_sector_num, 1, delayed_sector); | ||
987 | } | ||
988 | } | ||
989 | |||
990 | void ata_spindown(int seconds) | 959 | void ata_spindown(int seconds) |
991 | { | 960 | { |
992 | (void)seconds; | 961 | (void)seconds; |