linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Verych <olecom@gmail.com>
To: linux-sunxi@lists.linux.dev (open list:ARM/Allwinner sunXi SoC support)
Cc: Oleg Verych <olecom@gmail.com>,
	Maxime Ripard <mripard@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org (open list:ALLWINNER A10 CSI DRIVER)
Subject: [PATCH] media: sun4i-csi: Fix 'Unbalanced pm_runtime_enable!'
Date: Sat,  7 Jan 2023 11:37:49 +0300	[thread overview]
Message-ID: <20230107083749.2419-1-olecom@gmail.com> (raw)

When removing the module, balance PM runtime enable with
the corresponding disable call.

Signed-off-by: Oleg Verych <olecom@gmail.com>
---

dmesg:
```
[   32.570802] i2c-core: driver [ov5640] registered
[   32.585345] sun4i-csi 1c09000.csi: Device registered as video0
[  396.520467] random: crng init done
[ 1603.050944] ov5640 2-003c: remove
[ 1603.051878] i2c-core: driver [ov5640] unregistered
...
[ 1603.108832] i2c-core: driver [ov5640] registered
[ 1603.119400] sun4i-csi 1c09000.csi: Device registered as video0
[ 1603.119984] sun4i-csi 1c09000.csi: Unbalanced pm_runtime_enable!
```

 drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
index 18e6c65f4..86c5235a0 100644
--- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
+++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
@@ -264,6 +264,7 @@ static int sun4i_csi_remove(struct platform_device *pdev)
 {
 	struct sun4i_csi *csi = platform_get_drvdata(pdev);
 
+	pm_runtime_disable(&pdev->dev);
 	v4l2_async_nf_unregister(&csi->notifier);
 	v4l2_async_nf_cleanup(&csi->notifier);
 	vb2_video_unregister_device(&csi->vdev);
-- 
2.20.1

             reply	other threads:[~2023-01-07  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07  8:37 Oleg Verych [this message]
2023-01-09 20:24 ` [PATCH] media: sun4i-csi: Use CSI_INT_STA_REG name, fix typo in a comment Oleg Verych
2023-01-16 19:07   ` Sakari Ailus
2023-01-16 23:03     ` Oleg Verych

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230107083749.2419-1-olecom@gmail.com \
    --to=olecom@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mripard@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).