diff options
author | Jeffrey Hugo <jhugo@codeaurora.org> | 2021-02-12 14:27:23 -0700 |
---|---|---|
committer | Loic Poulain <loic.poulain@linaro.org> | 2021-02-15 11:36:49 +0100 |
commit | ae419de5e1b3b1bc54a242f0f34c65815ef70a7a (patch) | |
tree | d8401b7545b5067b868be975ba26d3d89ecb5874 | |
parent | 38a882255506602143cbddcc92f1fa01a6ec8aac (diff) |
bus: mhi: core: Fix check for syserr at power_up
The check to see if we have reset the device after detecting syserr at
power_up is inverted. wait_for_event_timeout() returns 0 on failure,
and a positive value on success. The check is looking for non-zero
as a failure, which is likely to incorrectly cause a device init failure
if syserr was detected at power_up. Fix this.
Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up")
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
-rw-r--r-- | drivers/bus/mhi/core/pm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index 625bf581ce2f..b3ed4636264b 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -1092,7 +1092,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl) &val) || !val, msecs_to_jiffies(mhi_cntrl->timeout_ms)); - if (ret) { + if (!ret) { ret = -EIO; dev_info(dev, "Failed to reset MHI due to syserr state\n"); goto error_bhi_offset; |