From 0a1c15f45c39429f5e6c92d9baf6c4b6932ec05f Mon Sep 17 00:00:00 2001 From: P L Sai Krishna Date: Wed, 15 Jul 2015 17:52:45 +0530 Subject: [PATCH] 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 Reviewed-by: Harini Katakam --- lib/sw_services/xilffs/src/diskio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/sw_services/xilffs/src/diskio.c b/lib/sw_services/xilffs/src/diskio.c index ea5d36b9..1a26e868 100644 --- a/lib/sw_services/xilffs/src/diskio.c +++ b/lib/sw_services/xilffs/src/diskio.c @@ -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 */