Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 161aadae authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

[media] v4l: of: Instead of zeroing bus_type and bus field separately, unify this



Zero the entire struct starting from bus_type. As more fields are added, no
changes will be needed in the function to reset their value explicitly.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 2b5166ef
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -149,8 +149,9 @@ int v4l2_of_parse_endpoint(const struct device_node *node,
	int rval;

	of_graph_parse_endpoint(node, &endpoint->base);
	endpoint->bus_type = 0;
	memset(&endpoint->bus, 0, sizeof(endpoint->bus));
	/* Zero fields from bus_type to until the end */
	memset(&endpoint->bus_type, 0, sizeof(*endpoint) -
	       offsetof(typeof(*endpoint), bus_type));

	rval = v4l2_of_parse_csi_bus(node, endpoint);
	if (rval)
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ struct v4l2_of_bus_parallel {
 */
struct v4l2_of_endpoint {
	struct of_endpoint base;
	/* Fields below this line will be zeroed by v4l2_of_parse_endpoint() */
	enum v4l2_mbus_type bus_type;
	union {
		struct v4l2_of_bus_parallel parallel;