mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
serial: 8250: hub6: Add cleanup code
At module load time a platform device is registered. That should be
undone when the module is unloaded.
Fixes: ec9f47cd6a ("[PATCH] Serial: Split 8250 port table")
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/4f1903ff2907f3e8bbabce345f628771e0bbd4e1.1786697789.git.u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c526404a4a
commit
a300273c45
|
|
@ -324,8 +324,10 @@ static inline void serial8250_pnp_exit(void) { }
|
|||
|
||||
#ifdef CONFIG_SERIAL_8250_HUB6
|
||||
int serial8250_hub6_init(void);
|
||||
void serial8250_hub6_exit(void);
|
||||
#else
|
||||
static inline int serial8250_hub6_init(void) { return 0; }
|
||||
static inline void serial8250_hub6_exit(void) { }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SERIAL_8250_RSA
|
||||
|
|
|
|||
|
|
@ -53,3 +53,8 @@ int __init serial8250_hub6_init(void)
|
|||
{
|
||||
return platform_device_register(&hub6_device);
|
||||
}
|
||||
|
||||
void __init_or_module serial8250_hub6_exit(void)
|
||||
{
|
||||
platform_device_unregister(&hub6_device);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ static int __init serial8250_init(void)
|
|||
serial8250_isa_devs = platform_device_alloc("serial8250", PLAT8250_DEV_LEGACY);
|
||||
if (!serial8250_isa_devs) {
|
||||
ret = -ENOMEM;
|
||||
goto unreg_pnp;
|
||||
goto unreg_hub6;
|
||||
}
|
||||
|
||||
ret = platform_device_add(serial8250_isa_devs);
|
||||
|
|
@ -342,6 +342,8 @@ static int __init serial8250_init(void)
|
|||
platform_device_del(serial8250_isa_devs);
|
||||
put_dev:
|
||||
platform_device_put(serial8250_isa_devs);
|
||||
unreg_hub6:
|
||||
serial8250_hub6_exit();
|
||||
unreg_pnp:
|
||||
serial8250_pnp_exit();
|
||||
unreg_uart_drv:
|
||||
|
|
@ -369,6 +371,7 @@ static void __exit serial8250_exit(void)
|
|||
platform_driver_unregister(&serial8250_isa_driver);
|
||||
platform_device_unregister(isa_dev);
|
||||
|
||||
serial8250_hub6_exit();
|
||||
serial8250_pnp_exit();
|
||||
|
||||
#ifdef CONFIG_SPARC
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user