aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
diff options
context:
space:
mode:
authorLijo Lazar <[email protected]>2023-06-15 08:43:23 +0000
committerAlex Deucher <[email protected]>2023-06-23 19:35:26 +0000
commit184d83848242b2465b466a0a8e6eb58f1df10407 (patch)
tree083bd1a399fd3a742206d3ebaf8db891d7bf3b7d /drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
parentdrm/amdgpu/atomfirmware: fix LPDDR5 width reporting (diff)
downloadkernel-184d83848242b2465b466a0a8e6eb58f1df10407.tar.gz
kernel-184d83848242b2465b466a0a8e6eb58f1df10407.zip
drm/amdgpu: Add vbios attribute only if supported
Not all devices carry VBIOS version information. Add the device attribute only if supported. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Le Ma <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
index 9ba4817a9148..f4e3c133a16c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
@@ -1791,6 +1791,15 @@ const struct attribute_group amdgpu_vbios_version_attr_group = {
.attrs = amdgpu_vbios_version_attrs
};
+int amdgpu_atombios_sysfs_init(struct amdgpu_device *adev)
+{
+ if (adev->mode_info.atom_context)
+ return devm_device_add_group(adev->dev,
+ &amdgpu_vbios_version_attr_group);
+
+ return 0;
+}
+
/**
* amdgpu_atombios_fini - free the driver info and callbacks for atombios
*