Skip to contentSkip to conversation

drm/amdgpu: use adev_to_drm to get drm device

PATCH In review Guchun Chen 2 participants 2 messages Aug 25, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: use adev_to_drm to get drm device

adev_to_drm is used everywhere in amdgpu code, so modify it to keep consistency.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +1 -1
index 8ee4e8491f39..6ea8980c8ad7 100644
@@ -402,7 +402,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
 		}
 	}
 
-	if (drm_dev_enter(&adev->ddev, &idx)) {
+	if (drm_dev_enter(adev_to_drm(adev), &idx)) {
 		amdgpu_ctx_set_stable_pstate(ctx, ctx->stable_pstate);
 		drm_dev_exit(idx);
 	}
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 25.08.22 um 09:48 schrieb Guchun Chen:

Quoted 4 lines

adev_to_drm is used everywhere in amdgpu code, so modify it to keep consistency.

Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +1 -1
index 8ee4e8491f39..6ea8980c8ad7 100644
@@ -402,7 +402,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
  		}
  	}
 
-	if (drm_dev_enter(&adev->ddev, &idx)) {
+	if (drm_dev_enter(adev_to_drm(adev), &idx)) {
  		amdgpu_ctx_set_stable_pstate(ctx, ctx->stable_pstate);
  		drm_dev_exit(idx);
  	}