> + if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
> + return -EOPNOTSUPP;
> +
> return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> VEND1_LED_REG(index),
> VEND1_LED_REG_A_EVENT,
This works, but maybe:
for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
if (rules == as21xxx_led_supported_pattern[i].pattern) {
val = as21xxx_led_supported_pattern[i].val;
return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
VEND1_LED_REG(index),
VEND1_LED_REG_A_EVENT,
FIELD_PREP(VEND1_LED_REG_A_EVENT,
val));
}
return -EOPNOTSUPP
}
Andrew