summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinjie Ruan <ruanjinjie@huawei.com>2024-09-23 11:42:50 +0800
committerAndi Shyti <andi.shyti@kernel.org>2024-09-27 11:48:21 +0200
commit0c8d604dea437b69a861479b413d629bc9b3da70 (patch)
treeb7c4e9f4dd88f0f1ff5b8c705c023606932b9e93
parent6d3405415f887aef5774c04ae9fefae63d82bdaf (diff)
downloadlwn-0c8d604dea437b69a861479b413d629bc9b3da70.tar.gz
lwn-0c8d604dea437b69a861479b413d629bc9b3da70.zip
i2c: xiic: Fix pm_runtime_set_suspended() with runtime pm enabled
It is not valid to call pm_runtime_set_suspended() for devices with runtime PM enabled because it returns -EAGAIN if it is enabled already and working. So, call pm_runtime_disable() before to fix it. Fixes: 36ecbcab84d0 ("i2c: xiic: Implement power management") Cc: <stable@vger.kernel.org> # v4.6+ Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
-rw-r--r--drivers/i2c/busses/i2c-xiic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 4c89aad02451..1d68177241a6 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1337,8 +1337,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
return 0;
err_pm_disable:
- pm_runtime_set_suspended(&pdev->dev);
pm_runtime_disable(&pdev->dev);
+ pm_runtime_set_suspended(&pdev->dev);
return ret;
}