]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV
authorGuenter Roeck <linux@roeck-us.net>
Wed, 8 Sep 2021 19:08:17 +0000 (12:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 20 Sep 2021 18:05:49 +0000 (11:05 -0700)
commitc3169bec3c1bf5d7e59c97e074eb185e13f5dca2
treea1fc1704bd77c604a186055bd439be02fffcba70
parent805c7a315a484a7093ad95314372938ad7b09e4e
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: cbcba4a359a0 ("drm/nouveau: expose pstate selection per-power source in sysfs")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c