[media] media: adv7604: automatic "default-input" selection
authorUlrich Hecht <[email protected]>
Thu, 22 Sep 2016 13:19:00 +0000 (10:19 -0300)
committerMauro Carvalho Chehab <[email protected]>
Mon, 24 Oct 2016 19:35:17 +0000 (17:35 -0200)
Documentation states that the "default-input" property should reside
directly in the node of the device.  This adjusts the parsing to make the
implementation consistent with the documentation.

Based on patch by William Towle <[email protected]>.

Signed-off-by: Ulrich Hecht <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
drivers/media/i2c/adv7604.c

index 4003831de712a3101d94e5f97b6b442ee7a74fca..fa7046ef09b274272e82afbb5fbaca2e3caf23b6 100644 (file)
@@ -3074,13 +3074,13 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
                return ret;
        }
 
-       if (!of_property_read_u32(endpoint, "default-input", &v))
+       of_node_put(endpoint);
+
+       if (!of_property_read_u32(np, "default-input", &v))
                state->pdata.default_input = v;
        else
                state->pdata.default_input = -1;
 
-       of_node_put(endpoint);
-
        flags = bus_cfg.bus.parallel.flags;
 
        if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)