diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2019-07-31 14:21:17 +0200 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2019-08-27 11:37:09 +0530 |
commit | 1eb9157ab3ef64e845e10fe40d49638fb408119e (patch) | |
tree | 838a3d4682a3470db7cb69e54827956a63af6f78 /drivers/phy/marvell | |
parent | ef0ac9f24b65bac389a21b2d37ab90200f285062 (diff) | |
download | lwn-1eb9157ab3ef64e845e10fe40d49638fb408119e.tar.gz lwn-1eb9157ab3ef64e845e10fe40d49638fb408119e.zip |
phy: mvebu-cp110-comphy: Cosmetic change in a helper
Before adding more logic, simplify a bit the writing of the
mvebu_comphy_get_mode() helper by using a pointer instead of
referencing a configuration with the entire table name.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy/marvell')
-rw-r--r-- | drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c index e4c0ec61dd04..98cb7298a9fe 100644 --- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c +++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c @@ -265,16 +265,18 @@ static int mvebu_comphy_get_mode(bool fw_mode, int lane, int port, 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; } @@ -282,9 +284,9 @@ static int mvebu_comphy_get_mode(bool fw_mode, int lane, int port, 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, |