Browse Source

fix(drivers/marvell/comphy-cp110): fix error code in pcie power on

Function polling_with_timeout() returns last value from polled register
on failure and zero on success. So set "ret" variable to error code
-ETIMEDOUT on error like it is done in other functions.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I16cac81bbcbe2113e139722dc0e8fc2b85428d1b
pull/1981/head
Pali Rohár 3 years ago
parent
commit
c0a909cdcc
  1. 6
      drivers/marvell/comphy/phy-comphy-cp110.c

6
drivers/marvell/comphy/phy-comphy-cp110.c

@ -1730,11 +1730,13 @@ static int mvebu_cp110_comphy_pcie_power_on(uint64_t comphy_base,
HPIPE_LANE_STATUS1_REG;
data = HPIPE_LANE_STATUS1_PCLK_EN_MASK;
mask = data;
ret = polling_with_timeout(addr, data, mask,
data = polling_with_timeout(addr, data, mask,
PLL_LOCK_TIMEOUT,
REG_32BIT);
if (ret)
if (data) {
ERROR("Failed to lock PCIE PLL\n");
ret = -ETIMEDOUT;
}
}
}

Loading…
Cancel
Save