mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
serial: 8250: Fix section mismatch with CONFIG_MODULES=n
Without CONFIG_MODULES, __init_or_module means __init, so serial8250_pnp_exit() and serial8250_hub6_exit() end up in .init.text. They are also called from serial8250_exit(), which is __exit, and modpost warns: WARNING: modpost: vmlinux: section mismatch in reference: serial8250_exit+0x2a (section: .exit.text) -> serial8250_pnp_exit (section: .init.text) The exit code never runs in such a kernel, so nothing breaks at runtime. But a function that is called from both __init and __exit code can't carry either annotation, so drop it. Fixes:a300273c45("serial: 8250: hub6: Add cleanup code") Fixes:4cf187f9de("serial: 8250: pnp: Annotate init and exit functions for conditional discarding") Assisted-by: LLM Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com> Link: https://patch.msgid.link/20260926163506.487201-1-danishkhateeb03@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b290393074
commit
c44a4925cd
|
|
@ -54,7 +54,7 @@ int __init serial8250_hub6_init(void)
|
|||
return platform_device_register(&hub6_device);
|
||||
}
|
||||
|
||||
void __init_or_module serial8250_hub6_exit(void)
|
||||
void serial8250_hub6_exit(void)
|
||||
{
|
||||
platform_device_unregister(&hub6_device);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ int __init serial8250_pnp_init(void)
|
|||
return pnp_register_driver(&serial_pnp_driver);
|
||||
}
|
||||
|
||||
void __init_or_module serial8250_pnp_exit(void)
|
||||
void serial8250_pnp_exit(void)
|
||||
{
|
||||
pnp_unregister_driver(&serial_pnp_driver);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user