Re: [PATCH v2] media: coda: Fix runtime PM imbalance in coda_probe()

2020-05-25 Thread Markus Elfring
> When coda_firmware_request() returns an error code,
> a pairing runtime PM usage counter decrement is needed
> to keep the counter balanced.

* I suggest to add an imperative wording.
  
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=9cb1fd0efd195590b828b9b865421ad345a4a145#n151

* Would you like to add the tag “Fixes” to the commit message?


> Changelog:

I propose to omit this line.


> ---
>  drivers/media/platform/coda/coda-common.c | 2 ++

I find it nicer to replace the triple dashes before this diffstat
by a blank line.

Regards,
Markus


[PATCH] [v2] media: coda: Fix runtime PM imbalance in coda_probe

2020-05-25 Thread Dinghao Liu
When coda_firmware_request() returns an error code,
a pairing runtime PM usage counter decrement is needed
to keep the counter balanced.

Signed-off-by: Dinghao Liu 
---

Changelog:

v2: - Remove changes to coda_remove(), which is incorrect.
---
 drivers/media/platform/coda/coda-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index d0d093dd8f7c..6e246c7a56c3 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -3119,6 +3119,8 @@ static int coda_probe(struct platform_device *pdev)
return 0;
 
 err_alloc_workqueue:
+   pm_runtime_disable(>dev);
+   pm_runtime_put_noidle(>dev);
destroy_workqueue(dev->workqueue);
 err_v4l2_register:
v4l2_device_unregister(>v4l2_dev);
-- 
2.17.1