Commit dc82e1bb authored by Timur Kristóf's avatar Timur Kristóf Committed by Alex Deucher
Browse files

drm/amd/display: Cleanup early return in construct_phy



Match pre-existing patterns in the DC code base.
Instead of returning early from the construct_phy() function,
add a label at the end and use goto to jump there.
Additionally, respect the DC logger and let it log the function
even when it returns early.

Suggested-by: default avatarRay Wu <Ray.Wu@amd.com>
Signed-off-by: default avatarTimur Kristóf <timur.kristof@gmail.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Link: https://lore.kernel.org/r/20251113163348.137315-4-timur.kristof@gmail.com


Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d46e422f
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -529,16 +529,16 @@ static bool construct_phy(struct dc_link *link,
	enc_init_data.transmitter = translate_encoder_to_transmitter(enc_init_data.encoder);
	enc_init_data.analog_engine = find_analog_engine(link);

	link->ep_type = DISPLAY_ENDPOINT_PHY;

	DC_LOG_DC("BIOS object table - link_id: %d", link->link_id.id);

	if (!transmitter_supported(enc_init_data.transmitter) &&
	    !analog_engine_supported(enc_init_data.analog_engine)) {
		DC_LOG_WARNING("link_id %d has unsupported encoder\n", link->link_id.id);
		return false;
		goto unsupported_fail;
	}

	link->ep_type = DISPLAY_ENDPOINT_PHY;

	DC_LOG_DC("BIOS object table - link_id: %d", link->link_id.id);

	if (bios->funcs->get_disp_connector_caps_info) {
		bios->funcs->get_disp_connector_caps_info(bios, link->link_id, &disp_connect_caps_info);
		link->is_internal_display = disp_connect_caps_info.INTERNAL_DISPLAY;
@@ -806,6 +806,7 @@ static bool construct_phy(struct dc_link *link,
		link->hpd_gpio = NULL;
	}

unsupported_fail:
	DC_LOG_DC("BIOS object table - %s failed.\n", __func__);
	return false;
}