]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/pm: Fix the return value in default case
authorMa Jun <Jun.Ma2@amd.com>
Wed, 18 Oct 2023 07:17:40 +0000 (15:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 Oct 2023 22:41:21 +0000 (18:41 -0400)
Fix the return value in default case and drop
redundant 'break'.

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index a0b8d5d78bebd0bcfd46c98c961b9c6e5c0c473c..9f86c1fecbb133667c4c02af93a1854177d56c5e 100644 (file)
@@ -2435,7 +2435,6 @@ int smu_get_power_limit(void *handle,
                break;
        default:
                return -EOPNOTSUPP;
-               break;
        }
 
        switch (pp_limit_level) {
@@ -2453,7 +2452,6 @@ int smu_get_power_limit(void *handle,
                break;
        default:
                return -EOPNOTSUPP;
-               break;
        }
 
        if (limit_type != SMU_DEFAULT_PPT_LIMIT) {
@@ -2487,7 +2485,7 @@ int smu_get_power_limit(void *handle,
                        *limit = smu->min_power_limit;
                        break;
                default:
-                       break;
+                       return -EINVAL;
                }
        }