]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
xilinx: v4l: vipp: Avoid decrementing refcount of a node twice
authorSatish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Wed, 10 Oct 2018 18:43:17 +0000 (11:43 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 11 Oct 2018 07:42:15 +0000 (09:42 +0200)
In the current implementation, driver is calling of_graph_get_next_endpoint()
and of_node_put() functions to get next endpoint and decrement refcount of a
node. As the former function is already decrementing refcount, there is no need
of calling the later function which decrements the refcount again.

This patch avoids calling of_node_put() function in driver, as the same has been
taken care in of_graph_get_next_endpoint() implementation.

Signed-off-by: Satish Kumar Nagireddy <satish.nagireddy.nagireddy@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/media/platform/xilinx/xilinx-vipp.c

index b9a1acabbdae543c2bd28c7004ce6c5ee611d576..5509040171e14f6d46a9b200a7aae384aaa1b04e 100644 (file)
@@ -98,7 +98,6 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev,
                if (next == NULL)
                        break;
 
-               of_node_put(ep);
                ep = next;
 
                dev_dbg(xdev->dev, "processing endpoint %pOF\n", ep);
@@ -183,7 +182,6 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev,
                }
        }
 
-       of_node_put(ep);
        return ret;
 }
 
@@ -252,7 +250,6 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
                if (next == NULL)
                        break;
 
-               of_node_put(ep);
                ep = next;
 
                dev_dbg(xdev->dev, "processing endpoint %pOF\n", ep);
@@ -328,7 +325,6 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
                }
        }
 
-       of_node_put(ep);
        return ret;
 }