vt: move set_leds to keyboard.c
set_leds and compute_shiftstate are called from a single place in vt.c. Let's combine these two into vt_set_leds_compute_shiftstate. This allows for making keyboard_tasklet local in the next patch. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210105120239.28031-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
01493ccb44
commit
63f24a7faf
@ -372,6 +372,12 @@ static void to_utf8(struct vc_data *vc, uint c)
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: review locking for vt.c callers */
|
||||
static void set_leds(void)
|
||||
{
|
||||
tasklet_schedule(&keyboard_tasklet);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called after returning from RAW mode or when changing consoles - recompute
|
||||
* shift_down[] and shift_state from key_down[] maybe called when keymap is
|
||||
@ -401,9 +407,12 @@ static void do_compute_shiftstate(void)
|
||||
}
|
||||
|
||||
/* We still have to export this method to vt.c */
|
||||
void compute_shiftstate(void)
|
||||
void vt_set_leds_compute_shiftstate(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
set_leds();
|
||||
|
||||
spin_lock_irqsave(&kbd_event_lock, flags);
|
||||
do_compute_shiftstate();
|
||||
spin_unlock_irqrestore(&kbd_event_lock, flags);
|
||||
|
@ -1036,8 +1036,7 @@ void redraw_screen(struct vc_data *vc, int is_switch)
|
||||
}
|
||||
set_cursor(vc);
|
||||
if (is_switch) {
|
||||
set_leds();
|
||||
compute_shiftstate();
|
||||
vt_set_leds_compute_shiftstate();
|
||||
notify_update(vc);
|
||||
}
|
||||
}
|
||||
|
@ -71,12 +71,6 @@ extern void (*kbd_ledfunc)(unsigned int led);
|
||||
extern int set_console(int nr);
|
||||
extern void schedule_console_callback(void);
|
||||
|
||||
/* FIXME: review locking for vt.c callers */
|
||||
static inline void set_leds(void)
|
||||
{
|
||||
tasklet_schedule(&keyboard_tasklet);
|
||||
}
|
||||
|
||||
static inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
|
||||
{
|
||||
return ((kbd->modeflags >> flag) & 1);
|
||||
@ -135,7 +129,7 @@ static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
|
||||
|
||||
struct console;
|
||||
|
||||
void compute_shiftstate(void);
|
||||
void vt_set_leds_compute_shiftstate(void);
|
||||
|
||||
/* defkeymap.c */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user