diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2018-07-18 09:20:34 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-10-04 16:14:42 -0400 |
commit | 32593dd0380929a871f49e1c5a401b2c8aff2823 (patch) | |
tree | dde6e9bcbd2f91bfc73530f5ab6d3f96e4dc0430 | |
parent | b4357d21d6744b76f8ab1dcaaa32d3bedb4ba565 (diff) |
media: v4l: fwnode: Parse the graph endpoint as last
Parsing the graph endpoint is always successful; therefore parse it as
last.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-fwnode.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index caf4aa964cbd..5f3bb3d1191c 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -303,7 +303,11 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode, pr_debug("===== begin V4L2 endpoint properties\n"); - fwnode_graph_parse_endpoint(fwnode, &vep->base); + /* + * Zero the fwnode graph endpoint memory in case we don't end up parsing + * the endpoint. + */ + memset(&vep->base, 0, sizeof(vep->base)); /* Zero fields from bus_type to until the end */ memset(&vep->bus_type, 0, sizeof(*vep) - @@ -346,6 +350,8 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode, return -EINVAL; } + fwnode_graph_parse_endpoint(fwnode, &vep->base); + return 0; } |