media: davinci: vpif: fix unbalanced runtime PM enable
commitd42b3ad105
upstream. Make sure to disable runtime PM before returning on probe errors. Fixes:479f7a1181
("[media] davinci: vpif: adaptions for DT support") Cc: stable@vger.kernel.org Cc: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
12159871e1
commit
2bd666b0fd
@ -428,6 +428,7 @@ static int vpif_probe(struct platform_device *pdev)
|
|||||||
static struct resource *res, *res_irq;
|
static struct resource *res, *res_irq;
|
||||||
struct platform_device *pdev_capture, *pdev_display;
|
struct platform_device *pdev_capture, *pdev_display;
|
||||||
struct device_node *endpoint = NULL;
|
struct device_node *endpoint = NULL;
|
||||||
|
int ret;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
vpif_base = devm_ioremap_resource(&pdev->dev, res);
|
vpif_base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
@ -457,8 +458,8 @@ static int vpif_probe(struct platform_device *pdev)
|
|||||||
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||||
if (!res_irq) {
|
if (!res_irq) {
|
||||||
dev_warn(&pdev->dev, "Missing IRQ resource.\n");
|
dev_warn(&pdev->dev, "Missing IRQ resource.\n");
|
||||||
pm_runtime_put(&pdev->dev);
|
ret = -EINVAL;
|
||||||
return -EINVAL;
|
goto err_put_rpm;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdev_capture = devm_kzalloc(&pdev->dev, sizeof(*pdev_capture),
|
pdev_capture = devm_kzalloc(&pdev->dev, sizeof(*pdev_capture),
|
||||||
@ -492,6 +493,12 @@ static int vpif_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_put_rpm:
|
||||||
|
pm_runtime_put(&pdev->dev);
|
||||||
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vpif_remove(struct platform_device *pdev)
|
static int vpif_remove(struct platform_device *pdev)
|
||||||
|
Reference in New Issue
Block a user