/* Description: Returns the index of the first valid setting less than or equal to the one pointed to by idx, as determined by the mask in features. Returns the index of the last setting if nothing else matches.  */
static int phy_find_valid(int idx, u32 features)
/* Description: Returns the index of the first valid setting less than or equal to the one pointed to by idx, as determined by the mask in features. Returns the index of the last setting if nothing else matches.  */
static int phy_find_valid(int idx, u32 features)
{
	while (idx < MAX_NUM_SETTINGS && !(settings[idx].setting & features))
		idx++;
	return idx < MAX_NUM_SETTINGS ? idx : MAX_NUM_SETTINGS - 1;
}