summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2022-10-28 13:58:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-03 03:44:40 +0100
commite3f0c638f428fd66b5871154b62706772045f91a (patch)
tree80171f80634b7511f24d461aa9fdeac33034dc1c /drivers/tty
parente828e56684d61b17317e0cfdef83791fa61cb76b (diff)
downloadlinux-e3f0c638f428fd66b5871154b62706772045f91a.tar.bz2
serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()
On remove, we get an error for "Runtime PM usage count underflow!". I guess this driver is mostly built-in, and this issue has gone unnoticed for a while. Somehow I did not catch this issue with my earlier fix done with commit 4e0f5cc65098 ("serial: 8250_omap: Fix probe and remove for PM runtime"). Fixes: 4e0f5cc65098 ("serial: 8250_omap: Fix probe and remove for PM runtime") Signed-off-by: Tony Lindgren <tony@atomide.com> Depends-on: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") Link: https://lore.kernel.org/r/20221028105813.54290-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250_omap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 766c57d50b4c..c6ec6eb7ee21 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1460,6 +1460,11 @@ err:
static int omap8250_remove(struct platform_device *pdev)
{
struct omap8250_priv *priv = platform_get_drvdata(pdev);
+ int err;
+
+ err = pm_runtime_resume_and_get(&pdev->dev);
+ if (err)
+ return err;
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_put_sync(&pdev->dev);