From f033c0bcc53675562200680f4cb4a86710d9fbae Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Mon, 1 Dec 2014 13:32:32 +0100 Subject: of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint Decrementing the reference count of the previous endpoint node allows to use the of_graph_get_next_endpoint function in a for_each_... style macro. All current users of this function that pass a non-NULL prev parameter (that is, soc_camera and imx-drm) are changed to not decrement the passed prev argument's refcount themselves. Signed-off-by: Philipp Zabel Acked-by: Mauro Carvalho Chehab Acked-by: Mathieu Poirier Acked-by: Laurent Pinchart Acked-by: Tomi Valkeinen --- drivers/media/platform/am437x/am437x-vpfe.c | 1 - drivers/media/platform/soc_camera/soc_camera.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/platform') diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c index 56a5cb0d2152..0d07fca756fe 100644 --- a/drivers/media/platform/am437x/am437x-vpfe.c +++ b/drivers/media/platform/am437x/am437x-vpfe.c @@ -2504,7 +2504,6 @@ vpfe_get_pdata(struct platform_device *pdev) GFP_KERNEL); pdata->asd[i]->match_type = V4L2_ASYNC_MATCH_OF; pdata->asd[i]->match.of.node = rem; - of_node_put(endpoint); of_node_put(rem); } diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index cee7b56f8404..f2a3d960b1a6 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c @@ -1694,7 +1694,6 @@ static void scan_of_host(struct soc_camera_host *ici) if (!i) soc_of_bind(ici, epn, ren->parent); - of_node_put(epn); of_node_put(ren); if (i) { @@ -1702,6 +1701,8 @@ static void scan_of_host(struct soc_camera_host *ici) break; } } + + of_node_put(epn); } #else -- cgit v1.2.2