xilffs: Card detection checked after disk status.

This patch does card detection check before disk
status call, since BaseAddress and card detect
variables will be assigned in disk_status API.

Signed-off-by: P L Sai Krishna <lakshmis@xilinx.com>
Reviewed-by: Harini Katakam <harinik@xilinx.com>
This commit is contained in:
P L Sai Krishna 2015-07-15 17:52:45 +05:30 committed by Nava kishore Manne
parent 2f7303ed76
commit 0a1c15f45c

View file

@ -229,6 +229,14 @@ DSTATUS disk_initialize (
XSdPs_Config *SdConfig;
/*
* Check if card is in the socket
*/
s = disk_status(pdrv);
if ((s & STA_NODISK) != 0U) {
return s;
}
if (CardDetect) {
/*
* Card detection check
@ -243,14 +251,6 @@ DSTATUS disk_initialize (
XSDPS_PSR_CARD_INSRT_MASK))));
}
/*
* Check if card is in the socket
*/
s = disk_status(pdrv);
if ((s & STA_NODISK) != 0U) {
return s;
}
/*
* Initialize the host controller
*/