media: adv7604: simplify of_node_put()
authorNicholas Mc Guire <hofrat@opentech.at>
Fri, 1 Jun 2018 09:21:32 +0000 (05:21 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 28 Jun 2018 10:48:52 +0000 (06:48 -0400)
As the of_node_put() is unconditional here there is no need to have it
twice.

Signed-off-by: Nicholas Mc Guire <hofrat@opentech.at>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/adv7604.c

index cac2081..1a3b2c0 100644 (file)
@@ -3108,12 +3108,9 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
                return -EINVAL;
 
        ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint), &bus_cfg);
-       if (ret) {
-               of_node_put(endpoint);
-               return ret;
-       }
-
        of_node_put(endpoint);
+       if (ret)
+               return ret;
 
        if (!of_property_read_u32(np, "default-input", &v))
                state->pdata.default_input = v;