hpfb: use probe_kernel_read()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 27 May 2017 03:44:41 +0000 (23:44 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 27 May 2017 19:41:17 +0000 (15:41 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/video/fbdev/hpfb.c

index 16f16f5e1a4bbc1e7d93d97d4b29b0f0356cb11a..9230db9ea94b7b68ba07251cb48202d1937d9309 100644 (file)
@@ -377,7 +377,6 @@ static struct dio_driver hpfb_driver = {
 int __init hpfb_init(void)
 {
        unsigned int sid;
-       mm_segment_t fs;
        unsigned char i;
        int err;
 
@@ -402,10 +401,7 @@ int __init hpfb_init(void)
        if (err)
                return err;
 
-       fs = get_fs();
-       set_fs(KERNEL_DS);
-       err = get_user(i, (unsigned char *)INTFBVADDR + DIO_IDOFF);
-       set_fs(fs);
+       err = probe_kernel_read(&i, (unsigned char *)INTFBVADDR + DIO_IDOFF, 1);
 
        if (!err && (i == DIO_ID_FBUFFER) && topcat_sid_ok(sid = DIO_SECID(INTFBVADDR))) {
                if (!request_mem_region(INTFBPADDR, DIO_DEVSIZE, "Internal Topcat"))