Commit 41eebd64 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab
Browse files

media: ipu-bridge: Move initialization of node_names.vcm to ipu_bridge_init_swnode_names()



Move initialization of node_names.vcm to ipu_bridge_init_swnode_names()
where it belongs.

And make the initialization of nodes[SWNODE_VCM] unconditional,
ipu_bridge_init_swnode_group() takes care of not registering it
when there is no VCM.

Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Reviewed-by: default avatarDaniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 11e0a7c8
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -201,6 +201,12 @@ static void ipu_bridge_init_swnode_names(struct ipu_sensor *sensor)
	snprintf(sensor->node_names.endpoint,
		 sizeof(sensor->node_names.endpoint),
		 SWNODE_GRAPH_ENDPOINT_NAME_FMT, 0); /* And endpoint 0 */
	if (sensor->ssdb.vcmtype) {
		/* append ssdb.link to distinguish nodes with same model VCM */
		snprintf(sensor->node_names.vcm, sizeof(sensor->node_names.vcm),
			 "%s-%u", ipu_vcm_types[sensor->ssdb.vcmtype - 1],
			 sensor->ssdb.link);
	}
}

static void ipu_bridge_init_swnode_group(struct ipu_sensor *sensor)
@@ -237,13 +243,7 @@ static void ipu_bridge_create_connection_swnodes(struct ipu_bridge *bridge,
						sensor->node_names.endpoint,
						&nodes[SWNODE_IPU_PORT],
						sensor->ipu_properties);
	if (sensor->ssdb.vcmtype) {
		/* append ssdb.link to distinguish VCM nodes with same HID */
		snprintf(sensor->node_names.vcm, sizeof(sensor->node_names.vcm),
			 "%s-%u", ipu_vcm_types[sensor->ssdb.vcmtype - 1],
			 sensor->ssdb.link);
	nodes[SWNODE_VCM] = NODE_VCM(sensor->node_names.vcm);
	}

	ipu_bridge_init_swnode_group(sensor);
}