enum phy_mode mode, int submode)
{
int i, n = ARRAY_SIZE(mvebu_comphy_cp110_modes);
+ const struct mvebu_comphy_conf *conf;
/* Unused PHY mux value is 0x0 */
if (mode == PHY_MODE_INVALID)
return 0;
for (i = 0; i < n; i++) {
- if (mvebu_comphy_cp110_modes[i].lane == lane &&
- mvebu_comphy_cp110_modes[i].port == port &&
- mvebu_comphy_cp110_modes[i].mode == mode &&
- mvebu_comphy_cp110_modes[i].submode == submode)
+ conf = &mvebu_comphy_cp110_modes[i];
+ if (conf->lane == lane &&
+ conf->port == port &&
+ conf->mode == mode &&
+ conf->submode == submode)
break;
}
return -EINVAL;
if (fw_mode)
- return mvebu_comphy_cp110_modes[i].fw_mode;
+ return conf->fw_mode;
else
- return mvebu_comphy_cp110_modes[i].mux;
+ return conf->mux;
}
static inline int mvebu_comphy_get_mux(int lane, int port,