diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-02-03 15:31:30 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2020-02-11 10:44:22 +0100 |
commit | ed31685c96e18f773ca11dd1a637974d62130673 (patch) | |
tree | 0cb9fcbf8d3ebb43a1382f6a2ed757547963e2b9 /kernel/printk | |
parent | e78bedbd42b7caa65551f3d56cbff451ccbd0aee (diff) |
console: Introduce ->exit() callback
Some consoles might require special operations on unregistering.
For instance, serial console, when registered in the kernel,
keeps power on for entire time, until it gets unregistered.
Example of use:
->setup(console):
pm_runtime_get(...);
->exit(console):
pm_runtime_put(...);
For such cases to have a balance we would provide ->exit() callback.
Link: http://lkml.kernel.org/r/20200203133130.11591-7-andriy.shevchenko@linux.intel.com
To: linux-kernel@vger.kernel.org
To: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'kernel/printk')
-rw-r--r-- | kernel/printk/printk.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index f435a17ef988..633f41a11d75 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2853,6 +2853,9 @@ int unregister_console(struct console *console) console_unlock(); console_sysfs_notify(); + if (console->exit) + res = console->exit(console); + return res; out_disable_unlock: |