Skip to contentSkip to conversation

drm/amdgpu: use drm_device pointer directly rather than convert again

PATCH In review Guchun Chen 2 participants 2 messages Mar 10, 2023

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

PATCH 2/2 drm/amdgpu: use drm_device pointer directly rather than convert again

The convert from adev is redundant.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index 41ef3368556b..2937912b7757 100644
@@ -5575,7 +5575,7 @@ int amdgpu_device_baco_enter(struct drm_device *dev)
 	struct amdgpu_device *adev = drm_to_adev(dev);
 	struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
 
-	if (!amdgpu_device_supports_baco(adev_to_drm(adev)))
+	if (!amdgpu_device_supports_baco(dev))
 		return -ENOTSUPP;
 
 	if (ras && adev->ras_enabled &&
@@ -5591,7 +5591,7 @@ int amdgpu_device_baco_exit(struct drm_device *dev)
 	struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
 	int ret = 0;
 
-	if (!amdgpu_device_supports_baco(adev_to_drm(adev)))
+	if (!amdgpu_device_supports_baco(dev))
 		return -ENOTSUPP;
 
 	ret = amdgpu_dpm_baco_exit(adev);
Signature · 1 line
2.25.1
Reviewed-by on v1 2/2
#1 lore raw

Am 10.03.23 um 06:04 schrieb Guchun Chen:

Quoted 3 lines

The convert from adev is redundant.

Quoted 26 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index 41ef3368556b..2937912b7757 100644
@@ -5575,7 +5575,7 @@ int amdgpu_device_baco_enter(struct drm_device *dev)
  	struct amdgpu_device *adev = drm_to_adev(dev);
  	struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
 
-	if (!amdgpu_device_supports_baco(adev_to_drm(adev)))
+	if (!amdgpu_device_supports_baco(dev))
  		return -ENOTSUPP;
 
  	if (ras && adev->ras_enabled &&
@@ -5591,7 +5591,7 @@ int amdgpu_device_baco_exit(struct drm_device *dev)
  	struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
  	int ret = 0;
 
-	if (!amdgpu_device_supports_baco(adev_to_drm(adev)))
+	if (!amdgpu_device_supports_baco(dev))
  		return -ENOTSUPP;
 
  	ret = amdgpu_dpm_baco_exit(adev);