diff options
author | Dave Airlie <airlied@linux.ie> | 2006-08-07 06:07:43 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-09-21 15:32:30 -0400 |
commit | 3d77461ecd7fb92bb888f69478e3518b3c947ce3 (patch) | |
tree | 8f5c01d7d50873e9361aa50a070f633bb77f838c /drivers/char/drm/drm_ioctl.c | |
parent | e478bec0ba0a83a48a0f6982934b6de079e7e6b3 (diff) |
drm: cleanup old compat code and DRM fns from Linux only code
This patch removes some of the old compatibility macros from the DRM,
and removes use of DRM wrappers from Linux specific code.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_ioctl.c')
-rw-r--r-- | drivers/char/drm/drm_ioctl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c index 555f323b8a32..31dfe83141ea 100644 --- a/drivers/char/drm/drm_ioctl.c +++ b/drivers/char/drm/drm_ioctl.c | |||
@@ -331,21 +331,23 @@ int drm_setversion(DRM_IOCTL_ARGS) | |||
331 | int if_version; | 331 | int if_version; |
332 | drm_set_version_t __user *argp = (void __user *)data; | 332 | drm_set_version_t __user *argp = (void __user *)data; |
333 | 333 | ||
334 | DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv)); | 334 | if (copy_from_user(&sv, argp, sizeof(sv))) |
335 | return -EFAULT; | ||
335 | 336 | ||
336 | retv.drm_di_major = DRM_IF_MAJOR; | 337 | retv.drm_di_major = DRM_IF_MAJOR; |
337 | retv.drm_di_minor = DRM_IF_MINOR; | 338 | retv.drm_di_minor = DRM_IF_MINOR; |
338 | retv.drm_dd_major = dev->driver->major; | 339 | retv.drm_dd_major = dev->driver->major; |
339 | retv.drm_dd_minor = dev->driver->minor; | 340 | retv.drm_dd_minor = dev->driver->minor; |
340 | 341 | ||
341 | DRM_COPY_TO_USER_IOCTL(argp, retv, sizeof(sv)); | 342 | if (copy_to_user(argp, &retv, sizeof(sv))) |
343 | return -EFAULT; | ||
342 | 344 | ||
343 | if (sv.drm_di_major != -1) { | 345 | if (sv.drm_di_major != -1) { |
344 | if (sv.drm_di_major != DRM_IF_MAJOR || | 346 | if (sv.drm_di_major != DRM_IF_MAJOR || |
345 | sv.drm_di_minor < 0 || sv.drm_di_minor > DRM_IF_MINOR) | 347 | sv.drm_di_minor < 0 || sv.drm_di_minor > DRM_IF_MINOR) |
346 | return EINVAL; | 348 | return EINVAL; |
347 | if_version = DRM_IF_VERSION(sv.drm_di_major, sv.drm_di_minor); | 349 | if_version = DRM_IF_VERSION(sv.drm_di_major, sv.drm_di_minor); |
348 | dev->if_version = DRM_MAX(if_version, dev->if_version); | 350 | dev->if_version = max(if_version, dev->if_version); |
349 | if (sv.drm_di_minor >= 1) { | 351 | if (sv.drm_di_minor >= 1) { |
350 | /* | 352 | /* |
351 | * Version 1.1 includes tying of DRM to specific device | 353 | * Version 1.1 includes tying of DRM to specific device |