]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Differentiate the lack of an interface from invalid parameter
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 13 Sep 2018 19:20:50 +0000 (20:20 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 14 Sep 2018 16:29:47 +0000 (17:29 +0100)
commit92933133e89faa36b46dab257023ba815d66250f
tree4f73d2f0c6f9065185b166b214be1a9085d05d9d
parent640850b93ecd9eff2c45c38e9a84e8edcb271cb3
drm: Differentiate the lack of an interface from invalid parameter

If the ioctl is not supported on a particular piece of HW/driver
combination, report ENOTSUP (aka EOPNOTSUPP) so that it can be easily
distinguished from both the lack of the ioctl and from a regular invalid
parameter.

v2: Across all the kms ioctls we had a mixture of reporting EINVAL,
ENODEV and a few ENOTSUPP (most where EINVAL) for a failed
drm_core_check_feature(). Update everybody to report ENOTSUPP.

v3: ENOTSUPP is an internal errno! It's value (524) does not correspond
to a POSIX errno, the one we want is ENOTSUP. However,
uapi/asm-generic/errno.h doesn't include ENOTSUP but man errno says

"ENOTSUP and EOPNOTSUPP have the same value on Linux,
but according to POSIX.1 these error values should be
distinct."

so use EOPNOTSUPP as its equivalent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v2
Link: https://patchwork.freedesktop.org/patch/msgid/20180913192050.24812-1-chris@chris-wilson.co.uk
23 files changed:
drivers/gpu/drm/drm_atomic_uapi.c
drivers/gpu/drm/drm_bufs.c
drivers/gpu/drm/drm_client.c
drivers/gpu/drm/drm_color_mgmt.c
drivers/gpu/drm/drm_connector.c
drivers/gpu/drm/drm_context.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_encoder.c
drivers/gpu/drm/drm_framebuffer.c
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/drm_ioctl.c
drivers/gpu/drm/drm_irq.c
drivers/gpu/drm/drm_lease.c
drivers/gpu/drm/drm_lock.c
drivers/gpu/drm/drm_mode_config.c
drivers/gpu/drm/drm_mode_object.c
drivers/gpu/drm/drm_pci.c
drivers/gpu/drm/drm_plane.c
drivers/gpu/drm/drm_prime.c
drivers/gpu/drm/drm_property.c
drivers/gpu/drm/drm_scatter.c
drivers/gpu/drm/drm_syncobj.c
drivers/gpu/drm/drm_vblank.c