From: Sakari Ailus Date: Wed, 21 Dec 2022 08:30:11 +0000 (+0100) Subject: media: ipu3-cio2: Fix PM runtime usage_count in driver unbind X-Git-Tag: v6.6.17~5419^2~2^2~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=909d3096ac99fa2289f9b8945a3eab2269947a0a;p=platform%2Fkernel%2Flinux-rpi.git media: ipu3-cio2: Fix PM runtime usage_count in driver unbind Get the PM runtime usage_count and forbid PM runtime at driver unbind. The opposite is being done in probe() already. Fixes: commit c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") Cc: stable@vger.kernel.org # for >= 4.16 Signed-off-by: Sakari Ailus Reviewed-by: Bingbu Cao Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c index 390bd5e..3b76a9d 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c @@ -1843,6 +1843,9 @@ static void cio2_pci_remove(struct pci_dev *pci_dev) v4l2_device_unregister(&cio2->v4l2_dev); media_device_cleanup(&cio2->media_dev); mutex_destroy(&cio2->lock); + + pm_runtime_forbid(&pci_dev->dev); + pm_runtime_get_noresume(&pci_dev->dev); } static int __maybe_unused cio2_runtime_suspend(struct device *dev)