lkml.org 
[lkml]   [2020]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 5/5] console: Introduce ->exit() callback
On (20/01/24 17:57), Andy Shevchenko wrote:
[..]
> +++ b/include/linux/console.h
> @@ -148,6 +148,7 @@ struct console {
> struct tty_driver *(*device)(struct console *, int *);
> void (*unblank)(void);
> int (*setup)(struct console *, char *);
> + void (*exit)(struct console *);
> int (*match)(struct console *, char *name, int idx, char *options);
> short flags;
> short index;
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index da6a9bdf76b6..0319bb698d05 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -2850,6 +2850,9 @@ int unregister_console(struct console *console)
> if (console_drivers != NULL && console->flags & CON_CONSDEV)
> console_drivers->flags |= CON_CONSDEV;
>
> + if (console->exit)
> + console->exit(console);
> +
> console->flags &= ~CON_ENABLED;
> console_unlock();
> console_sysfs_notify();

Do you need to call ->exit() under console_lock?

-ss

\
 
 \ /
  Last update: 2020-01-27 03:22    [W:0.072 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site