From: Ren Zhijie Date: Mon, 21 Nov 2022 13:04:18 +0000 (+0000) Subject: drm/amdgpu: fix unused-function error X-Git-Tag: v6.2-rc1~124^2~6^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7a3260c73d274daee652d57cbc934f47d1c0ef0;p=thirdparty%2Fkernel%2Flinux.git drm/amdgpu: fix unused-function error If CONFIG_DRM_AMDGPU=y and CONFIG_DRM_AMD_DC is not set, gcc complained about unused-function : drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1705:13: error: ‘amdgpu_discovery_set_sriov_display’ defined but not used [-Werror=unused-function] static void amdgpu_discovery_set_sriov_display(struct amdgpu_device *adev) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors To fix this error, use CONFIG_DRM_AMD_DC to wrap the definition of amdgpu_discovery_set_sriov_display(). Fixes: 25263da37693 ("drm/amdgpu: rework SR-IOV virtual display handling") Signed-off-by: Ren Zhijie Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index 6b48178455bc3..2509341df92d1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -1702,11 +1702,13 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev) return 0; } +#if defined(CONFIG_DRM_AMD_DC) static void amdgpu_discovery_set_sriov_display(struct amdgpu_device *adev) { amdgpu_device_set_sriov_virtual_display(adev); amdgpu_device_ip_block_add(adev, &amdgpu_vkms_ip_block); } +#endif static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev) {