[PATCH v2 8/8] serial: 8250: pnp: Annotate init and exit functions for conditional discarding

Uwe Kleine-König (The Capable Hub) <[email protected]> Tue, 4 Aug 2026 10:58:00 +0200
Newsgroups gmane.linux.serial,gmane.linux.kernel
Message-ID <efb88ec9bfcd7840b0d43f71a4b19b4b54b7a182.1785832297.git.u.kleine-koenig@baylibre.com>
serial8250_pnp_init() is only called from serial8250_init() which is
marked with __init, so the pnp init function can also get the same
marking. serial8250_pnp_exit() is only called from __init and __exit
code, so __init_or_module is appropriate for that.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <[email protected]>
---
 drivers/tty/serial/8250/8250_pnp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index 6bfdeff5fe22..7decf62400ab 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -526,12 +526,12 @@ static struct pnp_driver serial_pnp_driver = {
 	.id_table	= pnp_dev_table,
 };
 
-int serial8250_pnp_init(void)
+int __init serial8250_pnp_init(void)
 {
 	return pnp_register_driver(&serial_pnp_driver);
 }
 
-void serial8250_pnp_exit(void)
+void __init_or_module serial8250_pnp_exit(void)
 {
 	pnp_unregister_driver(&serial_pnp_driver);
 }
-- 
2.55.0.11.g153666a7d9bb