OSDN Git Service

media: adv748x: Zero entire struct v4l2_fwnode_endpoint
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 30 Sep 2020 11:49:15 +0000 (13:49 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Nov 2020 09:31:13 +0000 (10:31 +0100)
The v4l2_fwnode_parse_endpoint() function can make use of defaults in
multiple bus types. To use this feature, all callers must zero the rest of
the fields of this struct, too. All other drivers appear to do that
already apart from this one.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/adv748x/adv748x-core.c

index 1fe7f97..ae8b7eb 100644 (file)
@@ -589,14 +589,13 @@ static int adv748x_parse_csi2_lanes(struct adv748x_state *state,
                                    unsigned int port,
                                    struct device_node *ep)
 {
-       struct v4l2_fwnode_endpoint vep;
+       struct v4l2_fwnode_endpoint vep = { .bus_type = V4L2_MBUS_CSI2_DPHY };
        unsigned int num_lanes;
        int ret;
 
        if (port != ADV748X_PORT_TXA && port != ADV748X_PORT_TXB)
                return 0;
 
-       vep.bus_type = V4L2_MBUS_CSI2_DPHY;
        ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &vep);
        if (ret)
                return ret;