lib/sw_services/xilplmi/src/xplmi_dma.c
static int XPlmi_DmaDrvInit(XPmcDma *DmaPtr, u32 DeviceId)
{
	int Status = XST_FAILURE;
	XPmcDma_Config *Config;

	/*
	 * Initialize the PmcDma driver so that it's ready to use
	 * look up the configuration in the config table,
	 * then initialize it.
	 */
	Config = XPmcDma_LookupConfig((u16)DeviceId);
	if (NULL == Config) {
		Status = XPlmi_UpdateStatus(XPLMI_ERR_DMA_LOOKUP, 0);
		goto END;
	}

	Status = XPmcDma_CfgInitialize(DmaPtr, Config, Config->BaseAddress);
	if (Status != XST_SUCCESS) {
		Status = XPlmi_UpdateStatus(XPLMI_ERR_DMA_CFG, Status);
		goto END;
	}

	/*
	 * Performs the self-test to check hardware build.
	 */
	Status = XPmcDma_SelfTest(DmaPtr);
	if (Status != XST_SUCCESS) {
		Status = XPlmi_UpdateStatus(XPLMI_ERR_DMA_SELFTEST, Status);
	}

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function is used to initialize a single Driver instance.
 *
 * @param	DmaPtr is pointer to the DMA instance
 * @param	DeviceId of the DMA as defined in xparameters.h
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
*****************************************************************************/
@brief       This function is used to initialize a single Driver instance.
@param       DmaPtr is pointer to the DMA instance
@param       DeviceId of the DMA as defined in xparameters.h

@return      XST_SUCCESS on success and error code on failure
@brief This function is used to initialize a single Driver instance . @param DmaPtr is pointer to the DMA instance @param DeviceId of the DMA as defined in xparameters . h @return XST_SUCCESS on success and error code on failure
static int XPlmi_DmaDrvInit(XPmcDma *DmaPtr, u32 DeviceId)
{
	int Status = XST_FAILURE;
	XPmcDma_Config *Config;
	Config = XPmcDma_LookupConfig((u16)DeviceId);
	if (NULL == Config) {
		Status = XPlmi_UpdateStatus(XPLMI_ERR_DMA_LOOKUP, 0);
		goto END;
	}
	Status = XPmcDma_CfgInitialize(DmaPtr, Config, Config->BaseAddress);
	if (Status != XST_SUCCESS) {
		Status = XPlmi_UpdateStatus(XPLMI_ERR_DMA_CFG, Status);
		goto END;
	}
	Status = XPmcDma_SelfTest(DmaPtr);
	if (Status != XST_SUCCESS) {
		Status = XPlmi_UpdateStatus(XPLMI_ERR_DMA_SELFTEST, Status);
	}
END:
	return Status;
}
static int XPlmi_DmaDrvInit ( XPmcDma * DmaPtr , u32 DeviceId ) { int Status = XST_FAILURE ; XPmcDma_Config * Config ; Config = XPmcDma_LookupConfig ( ( u16 ) DeviceId ) ; if ( NULL == Config ) { Status = XPlmi_UpdateStatus ( XPLMI_ERR_DMA_LOOKUP , 0 ) ; goto END ; } Status = XPmcDma_CfgInitialize ( DmaPtr , Config , Config -> BaseAddress ) ; if ( Status != XST_SUCCESS ) { Status = XPlmi_UpdateStatus ( XPLMI_ERR_DMA_CFG , Status ) ; goto END ; } Status = XPmcDma_SelfTest ( DmaPtr ) ; if ( Status != XST_SUCCESS ) { Status = XPlmi_UpdateStatus ( XPLMI_ERR_DMA_SELFTEST , Status ) ; } END : return Status ; }
@brief       This function is used to initialize a single Driver instance.
@brief This function is used to initialize a single Driver instance .
/*
	 * Initialize the PmcDma driver so that it's ready to use
	 * look up the configuration in the config table,
	 * then initialize it.
	 */ /*
	 * Performs the self-test to check hardware build.
	 */