lib/sw_apps/zynqmp_pmufw/src/pm_requirement.c
s32 PmRequirementRelease(PmRequirement* const first, const PmReleaseScope scope)
{
	s32 status = XST_FAILURE;
	PmRequirement* req = first;

	if (RELEASE_ONE == scope) {
		PmRequirementClear(req);
		status = PmUpdateSlave(req->slave);
		goto done;
	}

	while (NULL != req) {
		if ((RELEASE_ALL == scope) ||
		   ((RELEASE_UNREQUESTED == scope) && !MASTER_REQUESTED_SLAVE(req))) {
			PmRequirementClear(req);
			status = PmUpdateSlave(req->slave);
			if (XST_SUCCESS != status) {
				break;
			}
		} else if (MASTER_REQUESTED_SLAVE(req)) {
			status = XST_SUCCESS;
		} else {
			/* Invalid Scope */
			PmErr("Invalid scope #%d\r\n", scope);
			status = XST_FAILURE;
			break;
		}

		req = req->nextSlave;
	}

done:
	return status;
}
/**
 * PmRequirementRelease() - Process release of requirements
 * @first	Pointer to the requirement structure
 * @scope	Scope of the release
 *
 * @return	Status of processing the release
 */
Process release of requirements
@first       Pointer to the requirement structure
@scope       Scope of the release

@return      Status of processing the release
Process release of requirements @first Pointer to the requirement structure @scope Scope of the release @return Status of processing the release
s32 PmRequirementRelease(PmRequirement* const first, const PmReleaseScope scope)
{
	s32 status = XST_FAILURE;
	PmRequirement* req = first;
	if (RELEASE_ONE == scope) {
		PmRequirementClear(req);
		status = PmUpdateSlave(req->slave);
		goto done;
	}
	while (NULL != req) {
		if ((RELEASE_ALL == scope) ||
		   ((RELEASE_UNREQUESTED == scope) && !MASTER_REQUESTED_SLAVE(req))) {
			PmRequirementClear(req);
			status = PmUpdateSlave(req->slave);
			if (XST_SUCCESS != status) {
				break;
			}
		} else if (MASTER_REQUESTED_SLAVE(req)) {
			status = XST_SUCCESS;
		} else {
			PmErr("Invalid scope #%d\r\n", scope);
			status = XST_FAILURE;
			break;
		}
		req = req->nextSlave;
	}
done:
	return status;
}
s32 PmRequirementRelease ( PmRequirement * const first , const PmReleaseScope scope ) { s32 status = XST_FAILURE ; PmRequirement * req = first ; if ( RELEASE_ONE == scope ) { PmRequirementClear ( req ) ; status = PmUpdateSlave ( req -> slave ) ; goto done ; } while ( NULL != req ) { if ( ( RELEASE_ALL == scope ) || ( ( RELEASE_UNREQUESTED == scope ) && ! MASTER_REQUESTED_SLAVE ( req ) ) ) { PmRequirementClear ( req ) ; status = PmUpdateSlave ( req -> slave ) ; if ( XST_SUCCESS != status ) { break ; } } else if ( MASTER_REQUESTED_SLAVE ( req ) ) { status = XST_SUCCESS ; } else { PmErr ( " \r \n " , scope ) ; status = XST_FAILURE ; break ; } req = req -> nextSlave ; } done : return status ; }
PmRequirementRelease() - Process release of requirements
 @first       Pointer to the requirement structure
 @scope       Scope of the release
PmRequirementRelease () - Process release of requirements @first Pointer to the requirement structure @scope Scope of the release
/* Invalid Scope */