Skip to content

Commit b7a3260

Browse files
Ren Zhijiealexdeucher
authored andcommitted
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: 25263da ("drm/amdgpu: rework SR-IOV virtual display handling") Signed-off-by: Ren Zhijie <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent abd5173 commit b7a3260

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,11 +1702,13 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev)
17021702
return 0;
17031703
}
17041704

1705+
#if defined(CONFIG_DRM_AMD_DC)
17051706
static void amdgpu_discovery_set_sriov_display(struct amdgpu_device *adev)
17061707
{
17071708
amdgpu_device_set_sriov_virtual_display(adev);
17081709
amdgpu_device_ip_block_add(adev, &amdgpu_vkms_ip_block);
17091710
}
1711+
#endif
17101712

17111713
static int amdgpu_discovery_set_display_ip_blocks(struct amdgpu_device *adev)
17121714
{

0 commit comments

Comments
 (0)