summaryrefslogtreecommitdiff
path: root/drivers/media/platform/stm32/stm32-dcmi.c
diff options
context:
space:
mode:
authorNicholas Mc Guire <hofrat@osadl.org>2018-06-12 13:23:16 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-06-28 07:49:29 -0400
commitf11552d030e8e5a0a945b1920e31eaf48fe3fad4 (patch)
tree32a3b572a9739426ca2645be528b1c46fb16aef9 /drivers/media/platform/stm32/stm32-dcmi.c
parentc2ee2243ce3763fef8da097851b2c07b73e18cdb (diff)
media: stm32-dcmi: simplify of_node_put usage
This does not fix any bug - this is just a code simplification. As np is not used after passing it to v4l2_fwnode_endpoint_parse() its refcount can be decremented immediately and at one location. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/stm32/stm32-dcmi.c')
-rw-r--r--drivers/media/platform/stm32/stm32-dcmi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index fcad6de06009..4f65f14fbbc1 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -1655,23 +1655,20 @@ static int dcmi_probe(struct platform_device *pdev)
}
ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(np), &ep);
+ of_node_put(np);
if (ret) {
dev_err(&pdev->dev, "Could not parse the endpoint\n");
- of_node_put(np);
return -ENODEV;
}
if (ep.bus_type == V4L2_MBUS_CSI2) {
dev_err(&pdev->dev, "CSI bus not supported\n");
- of_node_put(np);
return -ENODEV;
}
dcmi->bus.flags = ep.bus.parallel.flags;
dcmi->bus.bus_width = ep.bus.parallel.bus_width;
dcmi->bus.data_shift = ep.bus.parallel.data_shift;
- of_node_put(np);
-
irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_err(&pdev->dev, "Could not get irq\n");