LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] media: vpif: Fix runtime PM imbalance in vpif_probe
@ 2020-05-23 11:49 Dinghao Liu
  2020-05-27 17:26 ` Lad, Prabhakar
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-05-23 11:49 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Lad, Prabhakar, Mauro Carvalho Chehab, linux-media, linux-kernel

When platform_get_resource() returns an error code, a
pairing runtime PM usage counter decrement is needed
to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/media/platform/davinci/vpif.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/davinci/vpif.c b/drivers/media/platform/davinci/vpif.c
index df66461f5d4f..f28c1b27eac6 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c
@@ -458,6 +458,7 @@ static int vpif_probe(struct platform_device *pdev)
 	res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (!res_irq) {
 		dev_warn(&pdev->dev, "Missing IRQ resource.\n");
+		pm_runtime_put(&pdev->dev);
 		return -EINVAL;
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: vpif: Fix runtime PM imbalance in vpif_probe
  2020-05-23 11:49 [PATCH] media: vpif: Fix runtime PM imbalance in vpif_probe Dinghao Liu
@ 2020-05-27 17:26 ` Lad, Prabhakar
  0 siblings, 0 replies; 2+ messages in thread
From: Lad, Prabhakar @ 2020-05-27 17:26 UTC (permalink / raw)
  To: Dinghao Liu; +Cc: Kangjie Lu, Mauro Carvalho Chehab, linux-media, LKML

Hi Dinghao,

Thank you for the patch.

On Sat, May 23, 2020 at 12:49 PM Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:
>
> When platform_get_resource() returns an error code, a
> pairing runtime PM usage counter decrement is needed
> to keep the counter balanced.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>  drivers/media/platform/davinci/vpif.c | 1 +
>  1 file changed, 1 insertion(+)
>
Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
--Prabhakar

> diff --git a/drivers/media/platform/davinci/vpif.c b/drivers/media/platform/davinci/vpif.c
> index df66461f5d4f..f28c1b27eac6 100644
> --- a/drivers/media/platform/davinci/vpif.c
> +++ b/drivers/media/platform/davinci/vpif.c
> @@ -458,6 +458,7 @@ static int vpif_probe(struct platform_device *pdev)
>         res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>         if (!res_irq) {
>                 dev_warn(&pdev->dev, "Missing IRQ resource.\n");
> +               pm_runtime_put(&pdev->dev);
>                 return -EINVAL;
>         }
>
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 11:49 [PATCH] media: vpif: Fix runtime PM imbalance in vpif_probe Dinghao Liu
2020-05-27 17:26 ` Lad, Prabhakar

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git