From 9167bd96346473de5b61124f4589949fdf3026cf Mon Sep 17 00:00:00 2001 From: Arvind Sankar Date: Wed, 15 Jan 2020 11:07:50 -0500 Subject: sparc/console: kill off obsolete declarations commit 09d3f3f0e02c ("sparc: Kill PROM console driver.") missed removing the declarations of the deleted prom_con structure and prom_con_init function from console.h. Kill them off now. Signed-off-by: Arvind Sankar Signed-off-by: David S. Miller --- include/linux/console.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/linux/console.h') diff --git a/include/linux/console.h b/include/linux/console.h index d09951d5a94e..f33016b3a401 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -101,7 +101,6 @@ extern const struct consw *conswitchp; extern const struct consw dummy_con; /* dummy console buffer */ extern const struct consw vga_con; /* VGA text console */ extern const struct consw newport_con; /* SGI Newport console */ -extern const struct consw prom_con; /* SPARC PROM console */ int con_is_bound(const struct consw *csw); int do_unregister_con_driver(const struct consw *csw); @@ -201,7 +200,6 @@ extern void suspend_console(void); extern void resume_console(void); int mda_console_init(void); -void prom_con_init(void); void vcs_make_sysfs(int index); void vcs_remove_sysfs(int index); -- cgit v1.2.3-73-gaa49b From ed31685c96e18f773ca11dd1a637974d62130673 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Mon, 3 Feb 2020 15:31:30 +0200 Subject: 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 Signed-off-by: Andy Shevchenko Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek --- include/linux/console.h | 1 + kernel/printk/printk.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'include/linux/console.h') diff --git a/include/linux/console.h b/include/linux/console.h index d09951d5a94e..0cbd2a36aa00 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -149,6 +149,7 @@ struct console { struct tty_driver *(*device)(struct console *, int *); void (*unblank)(void); int (*setup)(struct console *, char *); + int (*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 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: -- cgit v1.2.3-73-gaa49b