[PATCH 4.18 157/197] drm/amdgpu: fix a reversed condition

From: Greg Kroah-Hartman
Date: Thu Sep 13 2018 - 10:02:41 EST


4.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Rex Zhu <rex.zhu@xxxxxxx>

commit ccf9ef0b0d10434dec5046bcfc4e834a7b1830fd upstream.

This test was reversed so it would end up leading to vddnb value
can't be read via hwmon on APU.

Reviewed-by: Evan Quan <evan.quan@xxxxxxx>
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>
Signed-off-by: Rex Zhu <Rex.Zhu@xxxxxxx>
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1157,7 +1157,7 @@ static ssize_t amdgpu_hwmon_show_vddnb(s
int r, size = sizeof(vddnb);

/* only APUs have vddnb */
- if (adev->flags & AMD_IS_APU)
+ if (!(adev->flags & AMD_IS_APU))
return -EINVAL;

/* Can't get voltage when the card is off */