lib/sw_apps/zynqmp_pmufw/src/pm_slave.c
s32 PmCheckCapabilities(const PmSlave* const slave, const u32 capabilities)
{
	PmStateId i;
	s32 status = XST_NO_FEATURE;

	for (i = 0U; i < slave->slvFsm->statesCnt; i++) {
		/* Find the first state that contains all capabilities */
		if ((capabilities & slave->slvFsm->states[i]) == capabilities) {
			status = XST_SUCCESS;
			break;
		}
	}

	return status;
}
/**
 * PmCheckCapabilities() - Check whether the slave has state with specified
 *                         capabilities
 * @slave   Slave pointer whose capabilities/states should be checked
 * @cap     Check for these capabilities
 *
 * @return  Status whether slave has a state with given capabilities
 *          - XST_SUCCESS if slave has state with given capabilities
 *          - XST_NO_FEATURE if slave does not have such state
 */
Check whether the slave has state with specified
capabilities
@slave   Slave pointer whose capabilities/states should be checked
@cap     Check for these capabilities

@return  Status whether slave has a state with given capabilities
- XST_SUCCESS if slave has state with given capabilities
- XST_NO_FEATURE if slave does not have such state
Check whether the slave has state with specified capabilities @slave Slave pointer whose capabilities / states should be checked @cap Check for these capabilities @return Status whether slave has a state with given capabilities - XST_SUCCESS if slave has state with given capabilities - XST_NO_FEATURE if slave does not have such state
s32 PmCheckCapabilities(const PmSlave* const slave, const u32 capabilities)
{
	PmStateId i;
	s32 status = XST_NO_FEATURE;
	for (i = 0U; i < slave->slvFsm->statesCnt; i++) {
		if ((capabilities & slave->slvFsm->states[i]) == capabilities) {
			status = XST_SUCCESS;
			break;
		}
	}
	return status;
}
s32 PmCheckCapabilities ( const PmSlave * const slave , const u32 capabilities ) { PmStateId i ; s32 status = XST_NO_FEATURE ; for ( i = 0U ; i < slave -> slvFsm -> statesCnt ; i ++ ) { if ( ( capabilities & slave -> slvFsm -> states [ i ] ) == capabilities ) { status = XST_SUCCESS ; break ; } } return status ; }
PmCheckCapabilities() - Check whether the slave has state with specified
                         capabilities
 @slave   Slave pointer whose capabilities/states should be checked
 @cap     Check for these capabilities
PmCheckCapabilities () - Check whether the slave has state with specified capabilities @slave Slave pointer whose capabilities / states should be checked @cap Check for these capabilities
/* Find the first state that contains all capabilities */