lib/sw_services/xilloader/src/xloader_sd.c
int XLoader_SdRelease(void)
 {
	int Status = XST_FAILURE;
	FRESULT Rc;

	Rc = f_close(&FFil);
	if (Rc != FR_OK) {
		XLoader_Printf(DEBUG_INFO, "SD: Unable to close file\n\r");
		Status = XPlmi_UpdateStatus(XLOADER_ERR_SD_F_CLOSE, (int)Rc);
		XLoader_Printf(DEBUG_GENERAL,"XLOADER_ERR_SD_F_CLOSE\n\r");
		goto END;
	}

	Rc = f_unmount(BootFile);
	if (Rc != FR_OK) {
		XLoader_Printf(DEBUG_INFO, "SD: Unable to unmount filesystem\n\r");
		Status = XPlmi_UpdateStatus(XLOADER_ERR_SD_UMOUNT, (int)Rc);
		XLoader_Printf(DEBUG_GENERAL,"XLOADER_ERR_SD_UMOUNT\n\r");
		goto END;
	}

END:
	Status = XPm_ReleaseDevice(PM_SUBSYS_PMC, SdDeviceNode,
		XPLMI_CMD_SECURE);
	XPlmi_Out32(SdCdnReg, SdCdnVal);
	return Status;
 }
/*****************************************************************************/
/**
 * @brief	This function is used to close the boot file and unmount the
 * file system.
 *
 * @param	None
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function is used to close the boot file and unmount the
file system.

@param       None

@return      XST_SUCCESS on success and error code on failure
@brief This function is used to close the boot file and unmount the file system . @param None @return XST_SUCCESS on success and error code on failure
int XLoader_SdRelease(void)
 {
	int Status = XST_FAILURE;
	FRESULT Rc;
	Rc = f_close(&FFil);
	if (Rc != FR_OK) {
		XLoader_Printf(DEBUG_INFO, "SD: Unable to close file\n\r");
		Status = XPlmi_UpdateStatus(XLOADER_ERR_SD_F_CLOSE, (int)Rc);
		XLoader_Printf(DEBUG_GENERAL,"XLOADER_ERR_SD_F_CLOSE\n\r");
		goto END;
	}
	Rc = f_unmount(BootFile);
	if (Rc != FR_OK) {
		XLoader_Printf(DEBUG_INFO, "SD: Unable to unmount filesystem\n\r");
		Status = XPlmi_UpdateStatus(XLOADER_ERR_SD_UMOUNT, (int)Rc);
		XLoader_Printf(DEBUG_GENERAL,"XLOADER_ERR_SD_UMOUNT\n\r");
		goto END;
	}
END:
	Status = XPm_ReleaseDevice(PM_SUBSYS_PMC, SdDeviceNode,
		XPLMI_CMD_SECURE);
	XPlmi_Out32(SdCdnReg, SdCdnVal);
	return Status;
 }
int XLoader_SdRelease ( void ) { int Status = XST_FAILURE ; FRESULT Rc ; Rc = f_close ( & FFil ) ; if ( Rc != FR_OK ) { XLoader_Printf ( DEBUG_INFO , " \n \r " ) ; Status = XPlmi_UpdateStatus ( XLOADER_ERR_SD_F_CLOSE , ( int ) Rc ) ; XLoader_Printf ( DEBUG_GENERAL , " \n \r " ) ; goto END ; } Rc = f_unmount ( BootFile ) ; if ( Rc != FR_OK ) { XLoader_Printf ( DEBUG_INFO , " \n \r " ) ; Status = XPlmi_UpdateStatus ( XLOADER_ERR_SD_UMOUNT , ( int ) Rc ) ; XLoader_Printf ( DEBUG_GENERAL , " \n \r " ) ; goto END ; } END : Status = XPm_ReleaseDevice ( PM_SUBSYS_PMC , SdDeviceNode , XPLMI_CMD_SECURE ) ; XPlmi_Out32 ( SdCdnReg , SdCdnVal ) ; return Status ; }
@brief       This function is used to close the boot file and unmount the
 file system.
@brief This function is used to close the boot file and unmount the file system .