drm/amdgpu: various cleanups for uvd/vce.
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 30 Mar 2017 07:45:52 +0000 (15:45 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 4 Apr 2017 17:40:33 +0000 (13:40 -0400)
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c

index 9a4129d881aa2e551255233d4c827006d2ba885d..8ab0f78794a5685af75dd6d9946e2854e00efe6a 100644 (file)
@@ -135,12 +135,9 @@ static int uvd_v4_2_sw_fini(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_uvd_sw_fini(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_uvd_sw_fini(adev);
 }
+
 static void uvd_v4_2_enable_mgcg(struct amdgpu_device *adev,
                                 bool enable);
 /**
@@ -230,11 +227,7 @@ static int uvd_v4_2_suspend(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_uvd_suspend(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_uvd_suspend(adev);
 }
 
 static int uvd_v4_2_resume(void *handle)
@@ -246,11 +239,7 @@ static int uvd_v4_2_resume(void *handle)
        if (r)
                return r;
 
-       r = uvd_v4_2_hw_init(adev);
-       if (r)
-               return r;
-
-       return r;
+       return uvd_v4_2_hw_init(adev);
 }
 
 /**
index e448f7d86bc09dfc8b751a122d0bd50e7a94feb5..bb6d46e168a3cdbd0401012a11493ec3700e38f2 100644 (file)
@@ -131,11 +131,7 @@ static int uvd_v5_0_sw_fini(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_uvd_sw_fini(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_uvd_sw_fini(adev);
 }
 
 /**
@@ -228,11 +224,7 @@ static int uvd_v5_0_suspend(void *handle)
                return r;
        uvd_v5_0_set_clockgating_state(adev, AMD_CG_STATE_GATE);
 
-       r = amdgpu_uvd_suspend(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_uvd_suspend(adev);
 }
 
 static int uvd_v5_0_resume(void *handle)
@@ -244,11 +236,7 @@ static int uvd_v5_0_resume(void *handle)
        if (r)
                return r;
 
-       r = uvd_v5_0_hw_init(adev);
-       if (r)
-               return r;
-
-       return r;
+       return uvd_v5_0_hw_init(adev);
 }
 
 /**
index 5679a4249bd97f479879ab0ddfd4f3bb3e7c4191..31db356476f8f1f72f488c54282a09409bcbb749 100644 (file)
@@ -134,11 +134,7 @@ static int uvd_v6_0_sw_fini(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_uvd_sw_fini(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_uvd_sw_fini(adev);
 }
 
 /**
@@ -230,11 +226,8 @@ static int uvd_v6_0_suspend(void *handle)
                return r;
 
        /* Skip this for APU for now */
-       if (!(adev->flags & AMD_IS_APU)) {
+       if (!(adev->flags & AMD_IS_APU))
                r = amdgpu_uvd_suspend(adev);
-               if (r)
-                       return r;
-       }
 
        return r;
 }
@@ -250,11 +243,7 @@ static int uvd_v6_0_resume(void *handle)
                if (r)
                        return r;
        }
-       r = uvd_v6_0_hw_init(adev);
-       if (r)
-               return r;
-
-       return r;
+       return uvd_v6_0_hw_init(adev);
 }
 
 /**
index 13f52e0af9b82e3b6b42588576a48035701b566a..8a9a90b00c935d1803e61fee25e89185e9484a7c 100644 (file)
@@ -438,11 +438,7 @@ static int uvd_v7_0_sw_fini(void *handle)
        for (i = 0; i < adev->uvd.num_enc_rings; ++i)
                amdgpu_ring_fini(&adev->uvd.ring_enc[i]);
 
-       r = amdgpu_uvd_sw_fini(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_uvd_sw_fini(adev);
 }
 
 /**
@@ -547,11 +543,8 @@ static int uvd_v7_0_suspend(void *handle)
                return r;
 
        /* Skip this for APU for now */
-       if (!(adev->flags & AMD_IS_APU)) {
+       if (!(adev->flags & AMD_IS_APU))
                r = amdgpu_uvd_suspend(adev);
-               if (r)
-                       return r;
-       }
 
        return r;
 }
@@ -567,11 +560,7 @@ static int uvd_v7_0_resume(void *handle)
                if (r)
                        return r;
        }
-       r = uvd_v7_0_hw_init(adev);
-       if (r)
-               return r;
-
-       return r;
+       return uvd_v7_0_hw_init(adev);
 }
 
 /**
index 49a6c45e65be45757e207c32e678b4328bddb5d2..47f70827195bff2e87fcada1d5843f864f3f86aa 100644 (file)
@@ -451,11 +451,7 @@ static int vce_v2_0_sw_fini(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_vce_sw_fini(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_vce_sw_fini(adev);
 }
 
 static int vce_v2_0_hw_init(void *handle)
@@ -495,11 +491,7 @@ static int vce_v2_0_suspend(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_vce_suspend(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_vce_suspend(adev);
 }
 
 static int vce_v2_0_resume(void *handle)
@@ -511,11 +503,7 @@ static int vce_v2_0_resume(void *handle)
        if (r)
                return r;
 
-       r = vce_v2_0_hw_init(adev);
-       if (r)
-               return r;
-
-       return r;
+       return vce_v2_0_hw_init(adev);
 }
 
 static int vce_v2_0_soft_reset(void *handle)
index db0adac073c61a440948523d1f397a22be6cef99..fb08193599092d0d6562e0c5b4c019b6be45bed2 100644 (file)
@@ -417,11 +417,7 @@ static int vce_v3_0_sw_fini(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_vce_sw_fini(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_vce_sw_fini(adev);
 }
 
 static int vce_v3_0_hw_init(void *handle)
@@ -471,11 +467,7 @@ static int vce_v3_0_suspend(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_vce_suspend(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_vce_suspend(adev);
 }
 
 static int vce_v3_0_resume(void *handle)
@@ -487,11 +479,7 @@ static int vce_v3_0_resume(void *handle)
        if (r)
                return r;
 
-       r = vce_v3_0_hw_init(adev);
-       if (r)
-               return r;
-
-       return r;
+       return vce_v3_0_hw_init(adev);
 }
 
 static void vce_v3_0_mc_resume(struct amdgpu_device *adev, int idx)
index becc5f744a98fe83e62dabb8ae56bd88e34065e7..2a3db99fbf1ee1f16ed262c134579930c560ab13 100644 (file)
@@ -527,11 +527,7 @@ static int vce_v4_0_sw_fini(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_vce_sw_fini(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_vce_sw_fini(adev);
 }
 
 static int vce_v4_0_hw_init(void *handle)
@@ -584,11 +580,7 @@ static int vce_v4_0_suspend(void *handle)
        if (r)
                return r;
 
-       r = amdgpu_vce_suspend(adev);
-       if (r)
-               return r;
-
-       return r;
+       return amdgpu_vce_suspend(adev);
 }
 
 static int vce_v4_0_resume(void *handle)
@@ -600,11 +592,7 @@ static int vce_v4_0_resume(void *handle)
        if (r)
                return r;
 
-       r = vce_v4_0_hw_init(adev);
-       if (r)
-               return r;
-
-       return r;
+       return vce_v4_0_hw_init(adev);
 }
 
 static void vce_v4_0_mc_resume(struct amdgpu_device *adev)