]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
phy: mvebu-cp110-comphy: fix mux error check
authorAntoine Tenart <antoine.tenart@free-electrons.com>
Mon, 18 Sep 2017 08:04:20 +0000 (10:04 +0200)
committerKishon Vijay Abraham I <kishon@ti.com>
Tue, 26 Sep 2017 11:32:48 +0000 (17:02 +0530)
The mux value is retrieved from the mvebu_comphy_get_mux() function
which returns an int. In mvebu_comphy_power_on() this int is stored to a
u32 and a check is made to ensure it's not negative. Which is wrong.
This fixes it.

Fixes: d0438bd6aa09 ("phy: add the mvebu cp110 comphy driver")
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/marvell/phy-mvebu-cp110-comphy.c

index 73ebad6634a79955340de255fb846b6acc815922..514a1a47e1fdea408b8907d7e7f7f4b6c7042cd1 100644 (file)
@@ -468,8 +468,8 @@ static int mvebu_comphy_power_on(struct phy *phy)
 {
        struct mvebu_comphy_lane *lane = phy_get_drvdata(phy);
        struct mvebu_comphy_priv *priv = lane->priv;
-       int ret;
-       u32 mux, val;
+       int ret, mux;
+       u32 val;
 
        mux = mvebu_comphy_get_mux(lane->id, lane->port, lane->mode);
        if (mux < 0)