mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-13 23:22:34 -05:00
Sansa AMS: handle properly SD transfer errors
clocks disabling and mutex unlocking were not made in case of errors git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21773 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
306753b1ed
commit
75fa699814
1 changed files with 8 additions and 4 deletions
|
|
@ -753,17 +753,21 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
|
|||
}
|
||||
}
|
||||
|
||||
ret = 0; /* success */
|
||||
|
||||
sd_transfer_error:
|
||||
|
||||
dma_release();
|
||||
|
||||
#ifndef BOOTLOADER
|
||||
led(false);
|
||||
sd_enable(false);
|
||||
#endif
|
||||
mutex_unlock(&sd_mtx);
|
||||
return 0;
|
||||
|
||||
sd_transfer_error:
|
||||
card_info[drive].initialized = 0;
|
||||
if (ret) /* error */
|
||||
card_info[drive].initialized = 0;
|
||||
|
||||
mutex_unlock(&sd_mtx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue