summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-05-26 23:51:09 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-06-09 23:50:58 -0400
commit9a4690379206695b63a175e227877490beb2eeda (patch)
treeb4d2e550bfc9b2b302900d4902d70cbf4ba91208 /drivers/video/fbdev
parentbcfe8ad8ef55a1cf3c935c2667e8e5ae598b3b7e (diff)
downloadlinux-9a4690379206695b63a175e227877490beb2eeda.tar.bz2
fb_get_fscreeninfo(): don't bother with do_fb_ioctl()
it's easier to do the right thing directly Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/core/fbmem.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 069fe7960df1..5324358f110f 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1331,22 +1331,13 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix,
static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
- mm_segment_t old_fs;
struct fb_fix_screeninfo fix;
- struct fb_fix_screeninfo32 __user *fix32;
- int err;
-
- fix32 = compat_ptr(arg);
-
- old_fs = get_fs();
- set_fs(KERNEL_DS);
- err = do_fb_ioctl(info, cmd, (unsigned long) &fix);
- set_fs(old_fs);
- if (!err)
- err = do_fscreeninfo_to_user(&fix, fix32);
-
- return err;
+ if (!lock_fb_info(info))
+ return -ENODEV;
+ fix = info->fix;
+ unlock_fb_info(info);
+ return do_fscreeninfo_to_user(&fix, compat_ptr(arg));
}
static long fb_compat_ioctl(struct file *file, unsigned int cmd,