Skip to content

Commit e8f71f8

Browse files
groecktorvalds
authored andcommitted
drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV
nvkm test builds fail with the following error. drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c: In function 'nvkm_control_mthd_pstate_info': drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c:60:35: error: overflow in conversion from 'int' to '__s8' {aka 'signed char'} changes value from '-251' to '5' The code builds on most architectures, but fails on parisc where ENOSYS is defined as 251. Replace the error code with -ENODEV (-19). The actual error code does not really matter and is not passed to userspace - it just has to be negative. Fixes: 7238eca ("drm/nouveau: expose pstate selection per-power source in sysfs") Signed-off-by: Guenter Roeck <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d8b1e10 commit e8f71f8

File tree

1 file changed

+1
-1
lines changed
  • drivers/gpu/drm/nouveau/nvkm/engine/device

1 file changed

+1
-1
lines changed

drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ nvkm_control_mthd_pstate_info(struct nvkm_control *ctrl, void *data, u32 size)
5757
args->v0.count = 0;
5858
args->v0.ustate_ac = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
5959
args->v0.ustate_dc = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
60-
args->v0.pwrsrc = -ENOSYS;
60+
args->v0.pwrsrc = -ENODEV;
6161
args->v0.pstate = NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN;
6262
}
6363

0 commit comments

Comments
 (0)