diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-09-13 22:20:50 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-09-14 19:29:47 +0300 |
commit | 69fdf4206a8ba91a277b3d50a3a05b71247635b2 (patch) | |
tree | 4f73d2f0c6f9065185b166b214be1a9085d05d9d /drivers/gpu/drm/drm_lease.c | |
parent | 6f19eb21a2ef9a2da938106ccc98e296ee02f4d3 (diff) | |
download | linux-69fdf4206a8ba91a277b3d50a3a05b71247635b2.tar.xz |
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
Diffstat (limited to 'drivers/gpu/drm/drm_lease.c')
-rw-r--r-- | drivers/gpu/drm/drm_lease.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index b54fb78a283c..5894b4e144d7 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -506,7 +506,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, /* Can't lease without MODESET */ if (!drm_core_check_feature(dev, DRIVER_MODESET)) - return -EINVAL; + return -EOPNOTSUPP; /* Do not allow sub-leases */ if (lessor->lessor) @@ -615,7 +615,7 @@ int drm_mode_list_lessees_ioctl(struct drm_device *dev, /* Can't lease without MODESET */ if (!drm_core_check_feature(dev, DRIVER_MODESET)) - return -EINVAL; + return -EOPNOTSUPP; DRM_DEBUG_LEASE("List lessees for %d\n", lessor->lessee_id); @@ -671,7 +671,7 @@ int drm_mode_get_lease_ioctl(struct drm_device *dev, /* Can't lease without MODESET */ if (!drm_core_check_feature(dev, DRIVER_MODESET)) - return -EINVAL; + return -EOPNOTSUPP; DRM_DEBUG_LEASE("get lease for %d\n", lessee->lessee_id); @@ -726,7 +726,7 @@ int drm_mode_revoke_lease_ioctl(struct drm_device *dev, /* Can't lease without MODESET */ if (!drm_core_check_feature(dev, DRIVER_MODESET)) - return -EINVAL; + return -EOPNOTSUPP; mutex_lock(&dev->mode_config.idr_mutex); |