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
This commit is contained in:
Pali Rohár 2021-09-24 14:43:54 +02:00
parent 49b664e75f
commit c0a909cdcc
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}
}
}