Skip to content

Commit 0c8d604

Browse files
Jinjie RuanAndi Shyti
authored andcommitted
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: 36ecbca ("i2c: xiic: Implement power management") Cc: <[email protected]> # v4.6+ Signed-off-by: Jinjie Ruan <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 6d34054 commit 0c8d604

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-xiic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,8 +1337,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
13371337
return 0;
13381338

13391339
err_pm_disable:
1340-
pm_runtime_set_suspended(&pdev->dev);
13411340
pm_runtime_disable(&pdev->dev);
1341+
pm_runtime_set_suspended(&pdev->dev);
13421342

13431343
return ret;
13441344
}

0 commit comments

Comments
 (0)