drm/amdgpu: optimize amdgpu device attribute code
authorKevin Wang <kevin1.wang@amd.com>
Mon, 27 Apr 2020 15:45:49 +0000 (23:45 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 18 May 2020 15:24:15 +0000 (11:24 -0400)
commit4e01847c38f7a5e2b0ffa8ff74d6bf0e85924240
tree5cebd8549ee5499135d5d7bd38747563cad0695e
parenta7f28103374787ae43b936cd2ec2f8388958668e
drm/amdgpu: optimize amdgpu device attribute code

unified amdgpu device attribute node functions:
1. add some helper functions to create amdgpu device attribute node.
2. create device node according to device attr flags on different VF mode.
3. rename some functions name to adapt a new interface.

v2:
1. remove ATTR_STATE_DEAD, ATTR_STATE_ALIVE enum.
2. rename callback function perform to attr_update.
3. modify some variable names

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h