misc: tizen-inform-reboot: Fix build error
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Mon, 17 Oct 2022 08:08:01 +0000 (17:08 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 3 Aug 2023 08:46:11 +0000 (17:46 +0900)
Used in another way instead of set_fs, since v5.10, set_fs cannot be
used.

Change-Id: I581e17a536f3cd8e57e9bd4bc37904ef288f1f5b
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/misc/tizen-inform-reboot.c

index 386c1f6..affc54a 100644 (file)
@@ -24,9 +24,7 @@ static int inform_reboot_notifier(struct notifier_block *nb,
        char *filename = CONFIG_TIZEN_INFORM_PATH;
        struct file *file;
        loff_t pos = 0;
-       mm_segment_t old_fs = get_fs();
-
-       set_fs(KERNEL_DS);
+       mm_segment_t old_fs = force_uaccess_begin();
 
        file = filp_open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644);
        if (file) {
@@ -56,7 +54,7 @@ static int inform_reboot_notifier(struct notifier_block *nb,
                                "Inform file path should be described correctly in config.\n");
        }
 
-       set_fs(old_fs);
+       force_uaccess_end(old_fs);
 
        return NOTIFY_DONE;
 }