lib/sw_services/xilpm/src/versal/client/pm_callbacks.c
XStatus XPm_NotifierAdd(XPm_Notifier* const Notifier)
{
	XStatus Status = (s32)XST_FAILURE;
	const XPm_Notifier* Curr;

	if (NULL == Notifier) {
		Status = (s32)XST_INVALID_PARAM;
		goto done;
	}

	/* Prevention of adding same Notifier in NotifierList */
	Curr = NotifierList;
	while (NULL != Curr) {
		if (Notifier == Curr) {
			break;
		}
		Curr = Curr->next;
	}

	if (NULL == Curr) {
		/* New notifiers are added at the front of list */
		Notifier->received = 0U;
		Notifier->next = NotifierList;
		NotifierList = Notifier;
	}

	Status = (s32)XST_SUCCESS;

done:
	return Status;
}
/****************************************************************************/
/**
 * @brief  Add notifier into the list
 *
 * @param  Notifier Pointer to notifier object which needs to be added
 *  in the list
 *
 * @return Returns XST_SUCCESS if notifier is added /
 *  XST_INVALID_PARAM if given notifier argument is NULL
 *
 * @note   None
 *
 ****************************************************************************/
@brief  Add notifier into the list
@param  Notifier Pointer to notifier object which needs to be added
in the list

@return Returns XST_SUCCESS if notifier is added
XST_INVALID_PARAM if given notifier argument is NULL

@note   None
@brief Add notifier into the list @param Notifier Pointer to notifier object which needs to be added in the list @return Returns XST_SUCCESS if notifier is added XST_INVALID_PARAM if given notifier argument is NULL @note None
XStatus XPm_NotifierAdd(XPm_Notifier* const Notifier)
{
	XStatus Status = (s32)XST_FAILURE;
	const XPm_Notifier* Curr;
	if (NULL == Notifier) {
		Status = (s32)XST_INVALID_PARAM;
		goto done;
	}
	Curr = NotifierList;
	while (NULL != Curr) {
		if (Notifier == Curr) {
			break;
		}
		Curr = Curr->next;
	}
	if (NULL == Curr) {
		Notifier->received = 0U;
		Notifier->next = NotifierList;
		NotifierList = Notifier;
	}
	Status = (s32)XST_SUCCESS;
done:
	return Status;
}
XStatus XPm_NotifierAdd ( XPm_Notifier * const Notifier ) { XStatus Status = ( s32 ) XST_FAILURE ; const XPm_Notifier * Curr ; if ( NULL == Notifier ) { Status = ( s32 ) XST_INVALID_PARAM ; goto done ; } Curr = NotifierList ; while ( NULL != Curr ) { if ( Notifier == Curr ) { break ; } Curr = Curr -> next ; } if ( NULL == Curr ) { Notifier -> received = 0U ; Notifier -> next = NotifierList ; NotifierList = Notifier ; } Status = ( s32 ) XST_SUCCESS ; done : return Status ; }
@brief  Add notifier into the list
 @param  Notifier Pointer to notifier object which needs to be added
  in the list
@brief Add notifier into the list @param Notifier Pointer to notifier object which needs to be added in the list
/* Prevention of adding same Notifier in NotifierList */ /* New notifiers are added at the front of list */