drm/amd/pm: use attr_update if the attr has it
authorSathishkumar S <sathishkumar.sundararaju@amd.com>
Wed, 26 May 2021 14:45:56 +0000 (20:15 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Jun 2021 02:36:40 +0000 (22:36 -0400)
use attr_update if its available as part of the attribute.
default_attr_update was used even if attr->attr_update is true.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Shashank Sharma <Shashank.sharma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c

index 13da377..f48132b 100644 (file)
@@ -1942,7 +1942,7 @@ static int amdgpu_device_attr_create(struct amdgpu_device *adev,
 
        BUG_ON(!attr);
 
-       attr_update = attr->attr_update ? attr_update : default_attr_update;
+       attr_update = attr->attr_update ? attr->attr_update : default_attr_update;
 
        ret = attr_update(adev, attr, mask, &attr_states);
        if (ret) {