hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/accessibility/braille/braille_console.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Minimalistic braille device kernel support.
34 *
....@@ -5,20 +6,6 @@
56 * Pressing Insert switches to VC browsing.
67 *
78 * Copyright (C) Samuel Thibault <samuel.thibault@ens-lyon.org>
8
- *
9
- * This program is free software ; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation ; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY ; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with the program ; if not, write to the Free Software
21
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
229 */
2310
2411 #include <linux/kernel.h>
....@@ -122,16 +109,16 @@
122109 /* Follow the VC cursor*/
123110 static void vc_follow_cursor(struct vc_data *vc)
124111 {
125
- vc_x = vc->vc_x - (vc->vc_x % WIDTH);
126
- vc_y = vc->vc_y;
127
- lastvc_x = vc->vc_x;
128
- lastvc_y = vc->vc_y;
112
+ vc_x = vc->state.x - (vc->state.x % WIDTH);
113
+ vc_y = vc->state.y;
114
+ lastvc_x = vc->state.x;
115
+ lastvc_y = vc->state.y;
129116 }
130117
131118 /* Maybe the VC cursor moved, if so follow it */
132119 static void vc_maybe_cursor_moved(struct vc_data *vc)
133120 {
134
- if (vc->vc_x != lastvc_x || vc->vc_y != lastvc_y)
121
+ if (vc->state.x != lastvc_x || vc->state.y != lastvc_y)
135122 vc_follow_cursor(vc);
136123 }
137124
....@@ -303,7 +290,7 @@
303290 break;
304291 case '\t':
305292 c = ' ';
306
- /* Fallthrough */
293
+ fallthrough;
307294 default:
308295 if (c < 32)
309296 /* Ignore other control sequences */
....@@ -360,8 +347,6 @@
360347 {
361348 int ret;
362349
363
- if (!(console->flags & CON_BRL))
364
- return 0;
365350 if (!console_options)
366351 /* Only support VisioBraille for now */
367352 console_options = "57600o8";
....@@ -384,8 +369,6 @@
384369 {
385370 if (braille_co != console)
386371 return -EINVAL;
387
- if (!(console->flags & CON_BRL))
388
- return 0;
389372 unregister_keyboard_notifier(&keyboard_notifier_block);
390373 unregister_vt_notifier(&vt_notifier_block);
391374 braille_co = NULL;