mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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 <lijo.lazar@amd.com> Reviewed-by: Le Ma <le.ma@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c09b3bf736
commit
184d838482
4 changed files with 15 additions and 2 deletions
|
@ -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
|
||||
*
|
||||
|
|
|
@ -217,5 +217,6 @@ int amdgpu_atombios_get_data_table(struct amdgpu_device *adev,
|
|||
|
||||
void amdgpu_atombios_fini(struct amdgpu_device *adev);
|
||||
int amdgpu_atombios_init(struct amdgpu_device *adev);
|
||||
int amdgpu_atombios_sysfs_init(struct amdgpu_device *adev);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4018,6 +4018,11 @@ fence_driver_init:
|
|||
/* Get a log2 for easy divisions. */
|
||||
adev->mm_stats.log2_max_MBps = ilog2(max(1u, max_MBps));
|
||||
|
||||
r = amdgpu_atombios_sysfs_init(adev);
|
||||
if (r)
|
||||
drm_err(&adev->ddev,
|
||||
"registering atombios sysfs failed (%d).\n", r);
|
||||
|
||||
r = amdgpu_pm_sysfs_init(adev);
|
||||
if (r)
|
||||
DRM_ERROR("registering pm sysfs failed (%d).\n", r);
|
||||
|
|
|
@ -2899,12 +2899,10 @@ static struct pci_error_handlers amdgpu_pci_err_handler = {
|
|||
|
||||
extern const struct attribute_group amdgpu_vram_mgr_attr_group;
|
||||
extern const struct attribute_group amdgpu_gtt_mgr_attr_group;
|
||||
extern const struct attribute_group amdgpu_vbios_version_attr_group;
|
||||
|
||||
static const struct attribute_group *amdgpu_sysfs_groups[] = {
|
||||
&amdgpu_vram_mgr_attr_group,
|
||||
&amdgpu_gtt_mgr_attr_group,
|
||||
&amdgpu_vbios_version_attr_group,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue